2017-09-26 164 views
-1

我在PluralSight上观看视频,然后我去github.com/aspnet/Mvc下载源文件并按照说明进行操作。.NET MVC核心当前的SDK不支持.NET标准2.0

当我下载的文件,并试图运行程序,我结束了:

Severity Code Description Project File Line Suppression State Error The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0. Microsoft.AspNetCore.Mvc.Formatters.Xml C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets 126

我也跟着this后并单独下载的2.0核心,但它仍然是给我这个错误。即使在我更新到Visual Studio 15.3之后。

任何帮助,非常感谢。谢谢!

Severity Code Description Project File Line Suppression State Error KRB1001 Package references have not been pinned. Run './build.cmd /t:Pin'. Also, you can run './build.cmd /t:Restore' which will pin and restore packages. 'build.cmd' can be found in 'C:\Users\ty_lo\source\Mvc\'. VersioningWebSite C:\Users\ty_lo\source\Mvc\Directory.Build.targets 12

+0

Global.aspx是ASP.NET MVC而不是ASP.NET Core MVC。最好的开始是官方文档:https://docs.microsoft.com/en-us/aspnet/core/ – Tseng

+0

你下载了2.0,但是你是否将项目设置更改为2.0? – Alexan

+0

@Alexan我在global.json文件中更改了版本,但是我没有在项目设置中更改它。这是如何完成的? – giggidy

回答

0

FIX

编辑

删除源文件,并重新克隆我打开该项目的项目,现在我收到此错误后,我似乎已经固定我的解决方案是转到工具 - >选项 - > NuGet包管理器 - >常规,然后确保选中“在Visual Studio中生成时自动检查丢失的包”。