简体   繁体   English

.NET MVC Core 当前 SDK 不支持 .NET Standard 2.0

[英].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.

相关问题 错误:当前的.NET SDK不支持定位.NET Standard 2.0 - Error: The current .NET SDK does not support targeting .NET Standard 2.0 .NET Core / .NET Standard 2.0中的ReliableSession / MaxRetryCount - ReliableSession / MaxRetryCount in .NET Core / .NET Standard 2.0 将.Net Standard 2.0 迁移到.Net Core 2.2 - Migrate .Net Standard 2.0 to .Net Core 2.2 ".NET Standard 2.0 获取当前操作系统" - .NET Standard 2.0 get current Operating System .net 标准 2.0 库中的 EF Core DbContext - EF Core DbContext in .net standard 2.0 library 在Azure .NET Core 2.0 SDK中管理凭据 - Managing Credentials in Azure .NET Core 2.0 SDK 如何通过仅使用.NET Core SDK直接调用C#编译器来编译.NET Standard 2.0类库? - How can I compile a .NET Standard 2.0 class library by directly invoking the C# complier using only the .NET Core SDK? 汇编版本不匹配? (.Net Core 2.0与.NET Standard 2类库) - Mismatch in assembly versioning? (.Net Core 2.0 with .NET Standard 2 class library) 引用生成EF Core dbcontext的.NET Standard 2.0项目的.NET Framework MVC项目。 为什么不起作用? - .NET Framework MVC project referencing a .NET Standard 2.0 project that generates a EF Core dbcontext. Why doesnt it work? 使用 .NET-Standard 2.0 项目构建 ASP.NET-Core 3.1 会导致冲突的 Microsoft.AspNetCore.Mvc.Analyzers 程序集 - Building ASP.NET-Core 3.1 with .NET-Standard 2.0 projects leads to conflicting Microsoft.AspNetCore.Mvc.Analyzers assemblies
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM