Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Visual Studio 2019: The project file cannot be opened. Unable to locate the .NET SDK

I just upgraded my visual studio 2019 to latest version 16.8.3 and suddenly I am not able to load any C# project and getting the following error for all .NET core projects:

The project file cannot be opened. Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.

like image 991
Dadwals Avatar asked Dec 09 '20 01:12

Dadwals


People also ask

Does Visual Studio 2019 include .NET Core SDK?

As you have seen, Visual Studio 2019 installer includes . NET Core 2.1 but not . NET Core 3.

Where .NET SDK is installed?

Navigate to C:\Program Files\dotnet\sdk and see if you can find folders associated with different sdk versions. If you can't find any folder there that means the sdk is not installed. In that case Install the sdk or repair it if you receive a message about it being already installed.

How do I check my .NET SDK version?

You can see both the SDK versions and runtime versions with the command dotnet --info . You'll also get other environmental related information, such as the operating system version and runtime identifier (RID).


1 Answers

Try to edit envrionment Variables.

Right click on This PC -> Properties -> Advanced System Settings -> Advanced -> Environment Variables -> System Variables

Add [install path] C:\Program Files\dotnet\ to the variable path.

Restart visual studio.

If it does not solve this problem, you can refer to this answer.

like image 146
Karney. Avatar answered Sep 20 '22 19:09

Karney.