After format my computer I reinstalled Vs 2017 V 15.6.3 and install ASP.Net Core SDK from Microsoft 2.1.4
But when I create new asp core application VS failed with e
in my case, I went to the folder C:\Program Files\dotnet\sdk delete the preview sdk folder, then on the command line run:
dotnet sdk 2.1.200
to set the correct sdk version for asp.net core. this fixed the problem.
You can check global.json file which you can find in solution root directory and make sure that the target SDK version in it installed on your machine or update it to one you already have it installed for example if you have SDK version 2.1.4 installed your global.json should look like this
{
"sdk":
{
"version": "2.1.400"
}
}
I was facing the same issue. I was running my project on .Net core 2.2. I tried every single solution given here but nothing worked. I repaired my visual studio and it's working fine now.
I solved this problem by modifying the first line in the .csproj file from:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
to:
<Project Sdk="Microsoft.NET.Sdk">
Thanks guys, i had reinstall older version of visual studio 2017 and it works well. My VS version is 15.4 and it's fine
This happened to me when I uninstalled a VS2015 instance of Visual Studio I had running side by side with VS2017.
I had to go out and reinstall the .Net Core sdk/runtime with the x86 version. I had already manually done the x64 versions of these but didn't think about visual studio running in 32bit.
These are the files:
dotnet-sdk-x.x.x-win-x86.exe
DotNetCore.x.x.x-WindowsHosting.exe