Warning NETSDK1071 A PackageReference to ‘Microsoft.AspNetCore.App’ specified a Version of `2.1.6`

There’s a few ways around this.

  • If you include the PackageReference but remove the Version attribute, it should make the warning go away. This is because it is a metapackage, which (simply put) is a type of package that gets the version based on your framework version, more here: https://learn.microsoft.com/en-us/dotnet/core/packages#metapackages

  • To disable the warnings, add AllowExplicitVersion:

<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.11" >
  <AllowExplicitVersion>true</AllowExplicitVersion> 
</PackageReference>

More here: https://github.com/dotnet/sdk/issues/2602

Leave a Comment