have tried upgrading to the professional version of visual studio 2017 v 15.6.0 (Preview 7.0)
and installed aspnetcore-runtime-2.1.0-preview1-final-win-x64 and .net
I am using Rider, I had
The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2
I had:
$ dotnet --list-sdks
2.1.2 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.2.202 [C:\Program Files\dotnet\sdk]
I tried keeping only the latest sdk, and had:
Project 'WebApplication3' load failed: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found..
So I removed everything and reinstalled 2.1.602. Made a new project from Rider. And it worked. Cannot say I understood how I solved it...
The issues for some peoples seems to be linked to global.json, see:
- https://docs.microsoft.com/fr-fr/aspnet/core/migration/21-to-22?view=aspnetcore-2.2&tabs=visual-studio
- https://docs.microsoft.com/fr-fr/dotnet/core/tools/global-json
- https://andrewlock.net/the-sdk-microsoft-net-sdk-web-specified-could-not-be-found/
Other things I did before (that did not seem to solve the issue but might have helped?):
- Updating Rider from 2018.3.2 to 2018.3.4 (latest).
- Installing Mono (was using the one from Unity when look into Rider build settings).
- Tried to use custom MSBuild from Jetbrain (the one used for Linux) without success.
- Installing everything related to .NET Core from VS installer.
- Update VS community ot latest.
- Reboot.
In Rider/Build, Execution, Deployement/Toolset and Build
I now have:
Mono executable: C:\Program Files\Mono\bin\mono.exe
- NET Core CLI executable: C:\Program Files\dotnet\dotnet.exe
- Use MS Build version (Auto detected 16.0): C:\Program - Files\dotnet\sdk\2.1.602\MSBuild.dll
Installing .NET Core SDK 2.1.300-preview2 did the trick for me:
UPDATE: just in case, there is a newer version has been released recently. You can download the new .NET Core SDK for 2.2.0-preview1 (which includes ASP.NET 2.2.0-preview1) here.
See also this answer when you are getting error like this in general:
The current .NET SDK does not support targeting .NET Core 2.X
I resolved the problem. the cause was that i installed
aspnetcore-runtime-2.1.0-preview1-final-win-x64
and .net core SDK 2.1.4-x64
versions. c:\Program Files\dotnet
c:\Program Files(x86)\dotnet
.To resolve this i
installed the x86 version of the sdk and aspnetcore runtime,
set the MSBuildSDKsPath environmental variable to point to the new installation path.
deleted all obsolete sdks from control panel
The question VS2017 Update 3 'Microsoft.NET.Sdk.Web' could not be found helped in resolving this issue.
Go to your pipeline. Click on Edit pipeline. Click on the Agent Specification dropdown. Change it to Windows 2019. Click Save And Queue.
And here you Go. It worked fine for me.
I had this problem and I did a fresh install of VS2017. That fixed it!
https://www.microsoft.com/net/download/visual-studio-sdks
You can download the SDK from the above site
check the SDK which is in your machine Path C:\Program Files\dotnet\sdk
Change or check the target framework in visual studio,
Right click on Startup Application or project => Application => Target Framework.
You can change the framework and build the solution and restore nugget packages.