简体   繁体   English

错误:当前的.NET SDK不支持定位.NET Standard 2.0

[英]Error: The current .NET SDK does not support targeting .NET Standard 2.0

Getting annoying build errors since upgrading to VS2017 (v15.18.6) and dot net core 2.1. 自升级到VS2017(v15.18.6)和点网核心2.1以来,烦人的构建错误。 I previously was able to build the .sln from https://github.com/MiniProfiler/dotnet . 我以前能够从https://github.com/MiniProfiler/dotnet构建.sln。

I'm new to the whole .net standard/core stuff (frankly find MS approach to this rather confusing and annoying!). 我是整个.net标准/核心知识的新手(坦率地说,找到MS方法来解决这个问题既令人困惑又烦人!)。 Anyway since the upgrade to the new VS2017 build and 2.1, I get the following 2 errors: 无论如何,自从升级到新的VS2017内部版本和2.1之后,我收到以下2个错误:

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版本。 MiniProfiler.Shared C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\Sdks\\Microsoft.NET.Sdk\\build\\Microsoft.NET.TargetFrameworkInference.targets 126 MiniProfiler.Shared C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ Community \\ MSBuild \\ Sdks \\ Microsoft.NET.Sdk \\ build \\ Microsoft.NET.TargetFrameworkInference.targets 126

Error NETSDK1050 The version of Microsoft.NET.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher. 错误NETSDK1050此项目使用的Microsoft.NET.Sdk版本不足以支持对以.NET Standard 1.5或更高版本为目标的库的引用。 Please install version 2.0 or higher of the .NET Core SDK. 请安装2.0版或更高版本的.NET Core SDK。 MiniProfiler.Shared C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\Microsoft\\Microsoft.NET.Build.Extensions\\Microsoft.NET.Build.Extensions.NETFramework.targets 67 MiniProfiler.Shared C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ Community \\ MSBuild \\ Microsoft \\ Microsoft.NET.Build.Extensions \\ Microsoft.NET.Build.Extensions.NETFramework.targets 67

在此处输入图片说明

Any ideas ? 有任何想法吗 ? I have searched online and seem various similar issues but I don't really understand the underlying issue. 我在网上搜索过,似乎出现了各种类似的问题,但我不太了解潜在的问题。

it seems you're using core and not targeting it. 看来您使用的是核心,而不是针对性的。 and it seems somehow you've brought standard and core into your app and thats causing a conflict. 似乎您已经以某种方式将标准和核心引入了您的应用程序,这导致了冲突。 go through youre dependencies and references and make sure all the .NET options are set to the same either core or standard. 检查您的依赖关系和引用,并确保所有.NET选项都设置为相同的核心或标准。 then once youve chosen youre version, make sure to set the target to match it. 然后,选择好您的版本后,请确保将目标设置为与之匹配。 standard is slightly more powerful at the moment, but its about to be depricated, so if you can switch to core and still have the functionality you need i reccomend doing do as this will increase the longevity of your project. 目前,standard的功能稍强一些,但是它即将被废止,因此,如果您可以切换到核心并且仍然拥有您需要的功能,那么我建议您这样做,因为这将增加项目的寿命。 plus linux and mac options. 加上linux和mac选项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当前的 .NET SDK 不支持面向 .NET Core 2.2 - The current .NET SDK does not support targeting .NET Core 2.2 无效 - 错误 NETSDK1045:当前 .NET SDK 不支持定位 .NET 6.0 - None worked - Error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0 当前的.NET SDK不支持定位.NET Core 2.2。 (SDK 2.2.202) - The current .NET SDK does not support targeting .NET Core 2.2. (SDK 2.2.202) 当前的 .NET SDK 不支持针对 .NET Core 2.1。 目标 .NET Core 1.1 或更低版本 - The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 1.1 or lower NETSDK1045 当前的 .NET SDK 不支持面向 .NET Core 3.1 - 由缓存引起? - NETSDK1045 The current .NET SDK does not support targeting .NET Core 3.1 - Caused by Cache? gitlab CI 中的 ASP.NET 核心项目构建错误:错误 NETSDK1045:当前 .NET SDK 不支持面向 .NET Core 5.0 - ASP.NET core project build error in gitlab CI : error NETSDK1045: The current .NET SDK does not support targeting .NET Core 5.0 .NET MVC Core 当前 SDK 不支持 .NET Standard 2.0 - .NET MVC Core current SDK not supporting .NET Standard 2.0 此项目使用的 Microsoft.NET.Sdk 版本不足以支持对面向 .NET Standard 1.5 或更高版本的库的引用 - The version of Microsoft.NET.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher 无法在面向 .Net Standard 2.0 的项目中加载 Revit API - Unable to load Revit API in a project targeting .Net Standard 2.0 针对.NET Core 2.0 - Targeting .NET Core 2.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM