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

15.2k views Asked by At

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.

enter image description here

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.

enter image description here

5

There are 5 answers

4
koelkastfilosoof On BEST ANSWER

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.

5
Balagurunathan Marimuthu On

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

Sample

2
boyukbas On

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"/>
0
kal On

On my side, I have to add the following to .csprj:

<PropertyGroup>
  <DependsOnNETStandard>netstandard2.0</DependsOnNETStandard>
</PropertyGroup>
<ItemGroup>
  <Reference Include="netstandard" />
</ItemGroup>
0
viking On

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.