[英].NET MVC Core current SDK not supporting .NET Standard 2.0
I am following a video on PluralSight and I went to github.com/aspnet/Mvc to download the source files and follow along.我正在关注 PluralSight 上的一个视频,我去 github.com/aspnet/Mvc 下载源文件并继续。
When I downloaded the files and tried to run the program, I ended up with:当我下载文件并尝试运行该程序时,我得到了:
Severity Code Description Project File Line Suppression State Error The current .NET SDK does not support targeting .NET Standard 2.0.
严重性代码描述项目文件行抑制状态错误当前的 .NET SDK 不支持面向 .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.
以 .NET Standard 1.6 或更低版本为目标,或使用支持 .NET Standard 2.0 的 .NET SDK 版本。 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
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
I have also followed this post and downloaded the 2.0 Core separately, but it is still giving me this error.我也跟着这篇文章单独下载了 2.0 Core,但它仍然给我这个错误。 Even after I updated to Visual Studio 15.3.
即使在我更新到 Visual Studio 15.3 之后。
Any help is greatly appreciated.任何帮助是极大的赞赏。 Thank you!
谢谢!
Edit编辑
After deleting the source files and re-cloning the project I open the project and I am now getting this error:删除源文件并重新克隆项目后,我打开项目,现在出现此错误:
Severity Code Description Project File Line Suppression State Error KRB1001 Package references have not been pinned.
严重性代码说明项目文件行抑制状态错误 KRB1001 包引用尚未固定。 Run './build.cmd /t:Pin'.
运行'./build.cmd /t:Pin'。 Also, you can run './build.cmd /t:Restore' which will pin and restore packages.
此外,您可以运行 './build.cmd /t:Restore' 这将固定和恢复包。 'build.cmd' can be found in 'C:\\Users\\ty_lo\\source\\Mvc\\'.
“build.cmd”可以在“C:\\Users\\ty_lo\\source\\Mvc\\”中找到。 VersioningWebSite C:\\Users\\ty_lo\\source\\Mvc\\Directory.Build.targets 12
VersioningWebSite C:\\Users\\ty_lo\\source\\Mvc\\Directory.Build.targets 12
修复:我似乎已经通过转到工具 -> 选项 -> NuGet 包管理器 -> 常规来修复我的解决方案,然后确保选中“在 Visual Studio 中构建期间自动检查丢失的包”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.