Skip to content

Referencing a shared framework does not flow across ProjectReference #2420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
natemcmaster opened this issue Jul 20, 2018 · 2 comments
Closed
Milestone

Comments

@natemcmaster
Copy link
Contributor

The value for the MicrosoftNETPlatformLibrary property does not flow across project references. This typically means that test projects will run on a shared framework that is different from the app they are testing.

Example scenario:

src/WebApp.csproj

	<TargetFramework>netcoreapp2.1</TargetFramework>
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />

test/WebAppTests.csproj

	<TargetFramework>netcoreapp2.1</TargetFramework>
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.1.1" />
	<ProjectReference Include="../src/WebApp.csproj" />
  • WebApp.runtimeconfig.json will contain "framework": { "name": "Microsoft.AspNetCore.App", "version": "2.1.1" }
  • WebAppTests.runtimeconfig.json contains "framework": { "name": "Microsoft.NETCore.App", "version": "2.1.0" }

The result is that WebAppTests will run ASP.NET Core binaries out of NuGet packages, but the WebApp will execute off a shared runtime. Because of patch and minor runtime rollforward, this can mean the tests are executing something very different than the app.

cc @dsplaisted

@dsplaisted dsplaisted added this to the 2.2.1xx milestone Jul 31, 2018
@natemcmaster natemcmaster changed the title MicrosoftNETPlatformLibrary does not flow across ProjectReference Referencing a shared framework does not flow across ProjectReference Dec 3, 2018
@natemcmaster
Copy link
Contributor Author

@dsplaisted @livarcocc any plans to address this in 3.0? This is still in the 2.2 milestone, but it's too late for 2.2 changes to address this. It seems like will continue to impact 3.0 projects using <FrameworkReference>.

@dsplaisted
Copy link
Member

This will be addressed in 3.0, with NuGet/Home#7342 (and the SDK work to consume it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants