简体   繁体   中英

.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.

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. 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

I have also followed this post and downloaded the 2.0 Core separately, but it is still giving me this error. Even after I updated to 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. 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

修复:我似乎已经通过转到工具 -> 选项 -> NuGet 包管理器 -> 常规来修复我的解决方案,然后确保选中“在 Visual Studio 中构建期间自动检查丢失的包”。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM