Error:
C:\\WebApp\\WebApp.csproj : error : The SDK \'Microsoft.NET.Sdk.Web\' specified could not be found. C:\\WebApp\\WebApp.csproj
uninstall and reinstall microsoft .NET core SDK. then restart visual studio. this works for me.
I edited the .csproj file and changed netcoreapp2.2 to netcoreapp2.1 in this stanza & then I was able to get it working.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
Choose the proper SDK according to your Visual Studio and Operating System. I downloaded the correct version from here https://dotnet.microsoft.com/download/visual-studio-sdks and after that .Net Core appeared in target frameworks list (there is a strict dependence between sdk version and VS version, so be careful).
As suggested in the comment, I updated global.json file as shown below
{
"sdk": {
"version": "1.0.0"
}
}
Also, I had to remove the <ItemGroup>
which contains wwwroot files path in .csproj file.
Reload the project and it works like a charm!
I've encountered the same problem, I just rename <project sdk="Microsoft.NET.Sdk.web">
to <project sdk="Microsoft.NET.Sdk">
on csproj
another situation: https://stackoverflow.com/a/55529011/2971851
issue details: 2.1.6xx & 2.2.2xx version of the SDKs are only supported on Visual Studio 2019. VS 2017 needs 2.1.5xx & 2.2.1xx versions of the SDK.
How to fix the issue? Install 2.1.5xx version of the SDK if you are targetting a 2.1 app Install 2.2.1xx version of the SDK if you are targetting a 2.2 app.
and according to the official document:
Note: If you are a Visual Studio user, there are MSBuild version requirements so use only the .NET Core SDK supported for each Visual Studio version. If you use other development environments, we recommend using the latest SDK release.
I have solved this issue by, go to this site, https://dotnet.microsoft.com/download In that, install both .NET Core Runtime and .NET Core SDK. After you install that, Open the Visual Studio 2017 with an administrator, Now The problem has been gone