Visual Studio 2022 cannot start debugging

Vivek Kahar (Student) 0 Reputation points
2024-03-07T15:57:01.87+00:00

Created a new project using C# Console app and .NET 8 Framework and I cannot run my code as it is greyed out

User's image

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,584 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
936 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
326 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 27,106 Reputation points Microsoft Vendor
    2024-03-08T03:04:49.5866667+00:00

    Hello @Vivek Kahar (Student) ,

    Welcome to Microsoft Q&A forum.

    I guess this issue only appears on .NET based projects on your side. If you use a .NET Framework(different from .NET) based project, it may work.

    User's image

    But, of course, .NET based projects should also work correctly. I think .NET was not installed correctly, or not set correctly.

    Please kindly check following:

    1. Search Edit the system environment variables in Windows Search box, open it, click Environment Variables button, find System variables -> Path, select and click Edit, make sure that C:\Program Files\dotnet\ is listed higher than C:\Program Files (x86)\dotnet\.
    2. Install .NET 8.0 separately and manually from here: Download .NET 8.0.

    Best Regards,

    Tianyu


    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.