sdk: EnsureNETCoreAppRuntime validation failed on 16.8 Preview 4
When an ASP .Net Core web project has RID <RuntimeIdentifier>win7-x64</RuntimeIdentifier>, then project load shows the following error
Project is targeting runtime ‘win7-x64’ but did not resolve any runtime-specific packages for the ‘Microsoft.NETCore.App’ package. This runtime may not be supported by .NET Core.
and the above error is from "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.targets"
I notice this error happening only on 16.8 Preview 4 build. (Version 16.8.0 Preview 4.0 [30509.233.main]) and the Dependencies tree shows some warning

Repro Steps:
- Create a ASP .Net Core project and then add win7-x64 as runtime identifier.
- unload and reload the project.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 38 (24 by maintainers)
Commits related to this issue
- Fix design-time build with RuntimeIdentifier specifiec for .NET Core 2.x Fixes #13513 — committed to dsplaisted/sdk by dsplaisted 4 years ago
This will be fixed in .NET SDK 5.0.101, which I believe will go out together with VS 16.8.3. So no need for a binlog or anything at this point.
I’m seeing this issue since upgrading to VS 16.8.2 for all projects on
netcoreapp3.1. Currently not seeing any runtime issues; workaround provided above does hide the error - I would like to remove<EnsureNETCoreAppRuntime>false</EnsureNETCoreAppRuntime>sooner rather than laterI also encountered this build error in VS 16.8.2 with a ASP.NET web app targeting netcoreapp2.2 and RuntimeIdentifier win-x64. Based on the suggestion of @dsplaisted, I workaround this issue by adding the following line to a
PropertyGroupwithin my .csproj filesVersion 16.9.0 Preview 2.0 [30618.5.main]
Modify whitespace in the project to trigger a build if needed.
There’s a
.binlogat\\mlangfs1\public\drnoakes\dotnet-sdk-issue-13513