Home > Software engineering >  Visual studio 2022 hangs on Debug.Launch()
Visual studio 2022 hangs on Debug.Launch()

Time:01-11

Summary:

The problem is when I launch an app which has Debug.Launch() with a new instance of visual studio 2022 [17.4.3] or visual studio 2022 Preview [17.5.0 Preview 2.0] it hangs forever. Same for visual studio 2019 [16.11.22]. I originally had it in source generator [build time]. So then I tested it with a console application as well to see if I get the same result (which I do get).

Steps:

Create Console App.

Add the following lines :

#if DEBUG
    if(!Debugger.IsAttached) Debugger.Launch();
#endif

Build the solution.

Start exe from debug folder.

Try to open with new instance of visual studio 2022. Visual studio hangs forever.

Error in Event viewer. Error

I do not use a test project in my solution.

Already tried the following:

  • Restart Pc
  • Deleted vs Folder
  • Repair Visual Studio (twice)
  • DISM.exe /Online /Cleanup-image /Restorehealth
  • sfc /scannow
  • Microsoft .NET Framework Repair Tool
  • Turn windows feature on or off => .NET Framework options turned off and back on (with restarting)
  • Restored pc-image to version when it was working => still fails
  • Copying folder to VM and installing lastest Visual Studio 2022 and running it there. => Also fails

CodePudding user response:

I installed Visual Studio 2022 [17.3.6] and now everything works again.

  • Related