简体   繁体   中英

The version of Microsoft.NET.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher

Im am encountering the following build error:

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.

在此处输入图片说明

Whenever I'm rebuilding a solution, this error will show. Has anybody a clue how to solve this? I'm sure I've installed Visual Studio 2017 (15.3.2) and .NET Core 2.0 properly.

在此处输入图片说明

I had the same issue. Adding <DependsOnNETStandard>false</DependsOnNETStandard> to your csproj file works for now. Have a look at https://github.com/dotnet/sdk/issues/1527 for more information.

You need to install .Net Core SDK 2.0 along with .Net 2.0 binaries (Runtime) . Please install the .Net Core 2.0 SDK based on your Target platform of your project either x86 or x64

.Net Core SDK 2.0 download from here

样品

I faced the same issue a few days ago. and Adding <DependsOnNETStandard> can not solve my problem. I just uninstalled the 'Microsoft .NET Core …' in Control Pannel. And then install the .net core again. This problem disappeared. Maybe it is a fastest way to resolve this issue.

What doesn't work (for me)?

  • I uninstalled VS2017, uninstalled all Dotnet related things from Control Panel, reinstalled everything again. Still, I got the same error. I uninstalled dotnet core versions and reinstalled them and it doesn't work.
  • "Adding false to your csproj file" kind of worked but this problem was only on my machine and I didn't want to use that if I don't have to.

What worked (for me)?

I opened targets file

C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\Microsoft\\Microsoft.NET.Build.Extensions\\Microsoft.NET.Build.Extensions.NETFramework.targets

Deleted this line

<NETBuildExtensionsError Condition="'$(DependsOnNETStandard)' == 'true' AND '$(NETStandardInbox)' != 'true' AND '$(_UsingOldSDK)' == 'true'" ResourceName="UnsupportedSDKVersionForNetStandard20"/>

Try to execute the command: "git clean -fdx" to clean up some (possible) trash file on your git repo.

Works for me.

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