我有以下警告

 Severity   Code    Description Project File    Line    Suppression State
Warning NETSDK1071  A PackageReference to 'Microsoft.AspNetCore.App' specified a Version of `2.1.6`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs    MyApi   C:\Program Files\dotnet\sdk\2.2.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets   153 

我试图通过编辑项目文件删除引用,然后添加nuget包,但是当我这么做时,很多引用不再正常工作.

我注意到错误是提到了sdk\2.2,我最近确实在我的计算机上安装了它,但在项目文件中没有对它的引用.

我正在使用VS2017 15.9.5

推荐答案

有几种方法可以解决这个问题.

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

更多信息请点击此处:https://github.com/dotnet/sdk/issues/2602

Asp.net相关问答推荐

如何在 IIS 上配置 Web Deploy 发布功能,以便开发人员可以发布?

ASP.NET Response.Redirect 使用 302 而不是 301

ASP.NET GridView 第二个标题行跨越主标题行

OnCheckedChanged 事件未触发

如何计算/查找给定日期的周数?

这两种方法有什么区别?

ASP.NET 日期时间 Select 器

HttpModules 的执行顺序是如何确定的?

ASP.NET vNext 与主机无关,这意味着什么?

从命令行复制 VS2008发布网站

在 ASP.NET 4.5 WebForms 中通过 bundle.config 与 BundleConfig.cs Bundle 资源

在 aspnetcore (netcoreapp1.0) 中替代 System.Web.Security.Membership.GeneratePassword

SignalR /signalr/hubs 404 未找到

如何使用restsharp下载文件

如何在 GridView 中隐藏 TemplateField 列

MSBuild DeployOnBuild=true 不发布

在 Asp.Net Core 中动态更改连接字符串

如何在 ASP.NET 响应中传递大文件?

try 为 Medium Trust 开发是否会失败?

ModelClientValidationRule 冲突