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

后端 未结 1 1418
礼貌的吻别
礼貌的吻别 2021-02-11 12:42

I have the following warning

 Severity   Code    Description Project File    Line    Suppression State
Warning NETSDK1071  A PackageReference to \'Microsoft.Asp         


        
相关标签:
1条回答
  • 2021-02-11 13:39

    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://docs.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

    0 讨论(0)
提交回复
热议问题