dotnet/roslyn

Cross targeted project with different targetframeworks fail to load MetadataReferences

jeromelaban opened this issue · 2 comments

Version Used:
VS15.4

Steps to Reproduce:

  1. Create an empty solution
  2. Create a project named A with <TargetFrameworks>net46;netstandard1.0</TargetFrameworks>
  3. Create project named B with <TargetFrameworks>net46;netstandard2.0</TargetFrameworks>
  4. Make the B project reference A
  5. With Roslyn workspace APIs do the following:
var props = new Dictionary<string, string>() { { "TargetFramework", "netstandard2.0" } };
var ws = MSBuildWorkspace.Create(props);
var project = await ws.OpenProjectAsync("B.csproj");

Expected Behavior:
The project.MetadataReferences member contains valid references.

Actual Behavior:
The project.MetadataReferences member is empty.

The loaded project B will be in a inconsistent state, as MSBuildWorkspace will try to load the A project using netstandard2.0, which it does not support.

Oh wow, has this not been looked at since January? I'm running into the same issue, and it looks like there just isn't a solution for this.

Can we get some help on this one please?