1
votes

I am breaking my head over this for a while now:

I have tried installing both professional and community version of visual studio 2017 v 15.5.2

and installed .net core Runtime 2.0.3 and .net core SDK 2.1.2.

When I open a new web application I get an error saying

"the sdk 'microsoft.net.sdk.web' specified could not be found"

When I try to build an existing project I get an error

"the current .NET SDK does not support targeting .NET Core 2.0. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.0."

I don't see ".net core 2.0" in my target framework

I don't have global.json file in my computer

When I try dotnet --info, I get this

.NET Command Line Tools (2.1.2)

Product Information:

Version: 2.1.2

Commit SHA-1 hash: 5695315371

Runtime Environment:

OS Name: Windows

OS Version: 10.0.10586

OS Platform: Windows

RID: win10-x64

Base Path: C:\Program Files\dotnet\sdk\2.1.2\

Microsoft .NET Core Shared Framework Host

Version : 2.0.3

Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df

Some one please help

1
Tried it but no luck :(Srikanth Ramamurthy
open cmd and run dotnet --version and look which version it shows. maybe you still have old 1.x versions installed. remove themmagicandre1981
C:\windows\system32>dotnet --version 2.1.3Srikanth Ramamurthy

1 Answers

3
votes

Fixed it by adding a MSBuildSdksPath userVariable.

Add an Enviroment variable named MSBuildSdksPath.

It's value should point to a Dotnet SDK folder. Eg:

C:\Program Files\dotnet\sdk\2.2.102\Sdks