TymeB
TymeB

Reputation: 21

Visual studio 2022 hangs on Debug.Launch()

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:

  1. Create Console App.

  2. Add the following lines :

#if DEBUG
    if(!Debugger.IsAttached) Debugger.Launch();
#endif
  1. Build the solution (in Debug).

  2. Start exe from debug folder.

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

I also opened the following ticket.

Already tried the following:

Upvotes: 2

Views: 2268

Answers (1)

TymeB
TymeB

Reputation: 21

After installing an older version of visual studio (Visual Studio 2022 [17.3.6] Professional) I could open open the console.exe with Debug.Launch(). And the hanging was resolved.

Since you can't install an older community version of visual studio you need to install a professional version.

You can download it from here Microsoft release history.

Upvotes: 0

Related Questions