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 image

Repro Steps:

  1. Create a ASP .Net Core project and then add win7-x64 as runtime identifier.
  2. 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

Most upvoted comments

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 later

I 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 PropertyGroup within my .csproj files

    <EnsureNETCoreAppRuntime>false</EnsureNETCoreAppRuntime> 

Version 16.9.0 Preview 2.0 [30618.5.main]

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
  </ItemGroup>

</Project>

Modify whitespace in the project to trigger a build if needed.

image

There’s a .binlog at \\mlangfs1\public\drnoakes\dotnet-sdk-issue-13513