can not open sln

Nick 0 Reputation points
2023-02-17T19:52:33.51+00:00

I am using windows 11, Visual Studio 2022 Enterprise.

When I try to open a solution, I can not load it. It says projectname(unloaded) and it has this error:

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

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,370 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 30,791 Reputation points Microsoft Vendor
    2023-02-20T04:49:29.09+00:00

    Hi @Nick, 

    Welcome to Microsoft Q&A! 

    What is your project type? Do you have global.json file in your project folder? If so, please try to rename or delete the file. 

    Besides, please check your System environment variables if there are two paths to dotnet.

    C:\Program Files\dotnet

    C:\Porgram Files (x86)\dotnet 

    If so, please delete this one: C:\Porgram Files (x86)\dotnet.

    Then, restart your computer and check if the project can be loaded normally. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.