Closed
Description
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels