简体   繁体   中英

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. I previously was able to build the .sln from https://github.com/MiniProfiler/dotnet .

I'm new to the whole .net standard/core stuff (frankly find MS approach to this rather confusing and annoying!). Anyway since the upgrade to the new VS2017 build and 2.1, I get the following 2 errors:

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. 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. Please install version 2.0 or higher of the .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

在此处输入图片说明

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. 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. plus linux and mac options.

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