Skip to content

When some projects target net7.0, and their dependencies dual-target net6.0, net7.0, cracking doesn't work #202

Open
@safesparrow

Description

@safesparrow

Describe the bug
Given a two-project setup:

  1. A.fsproj targets net6.0, net7.0,
  2. B.fsproj targets net7.0 and references A.fsproj

ProjInfo defaults to net6.0 for A, and net7.0 for B.
B's -r arg points to a net7.0 ref assembly, but FSharpOptions for A use net6.0, so there is no match and reference isn't loaded by FCS.

To Reproduce
Steps to reproduce the behaviour:

  1. Checkout https://github.com/giraffe-fsharp/Giraffe
  2. Crack Giraffe.sln using the following code
open System
open System.IO
open Ionide.ProjInfo

let slnPath = @"c:\projekty\fsharp\samples\Giraffe\Giraffe.sln"
let slnDir = Path.GetDirectoryName(slnPath)
let toolsPath = Init.init (DirectoryInfo(slnDir)) None
let globalProps = [ "Configuration", "Debug" ]
let workspaceLoader = WorkspaceLoaderViaProjectGraph.Create(toolsPath, globalProps)
let projects = workspaceLoader.LoadSln(slnPath)
let fcsProjects = FCS.mapManyOptions projects |> Seq.toArray
  1. See in a debugger that the ReferencedProjects shows A.fsproj using net6.0:
    image
    while OtherOptions section shows a reference to a net7.0 ref dll.
    image

This causes a mismatch and results in not loading the referenced project.

Expected behaviour

Project options should be internally consistent and allow for project references to be recognised by FCS.

Environment (please complete the following information):

  • OS: Win11
  • Ionide version: Ionide.ProjInfo.FCS 0.63.0
  • dotnet SDK version: 8.0.101

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions