Open safesparrow opened 9 months ago
I'm pretty sure this is a consequence of our 'first TFM wins' approach to ordering here. The minimal workaround would be to swap the order of TFMs in A.fsproj
, but of course that won't work as a general solution.
A proper treatment would likely have to include us redoing our handling of multi-targeted projects - they don't really have a sensible default for OutputPath
and other related properties - instead those properties should only ever be valid at a single-TFM level.
Describe the bug Given a two-project setup:
A.fsproj
targetsnet6.0, net7.0
,B.fsproj
targetsnet7.0
and referencesA.fsproj
ProjInfo defaults to
net6.0
forA
, andnet7.0
forB
.B
's-r
arg points to anet7.0
ref assembly, butFSharpOptions
forA
usenet6.0
, so there is no match and reference isn't loaded by FCS.To Reproduce Steps to reproduce the behaviour:
Giraffe.sln
using the following codelet 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