Home > Enterprise >  Visual Studio 2022 sometimes shows "The application was unable to start correctly"
Visual Studio 2022 sometimes shows "The application was unable to start correctly"

Time:12-17

I'm writing a console program in .NET 6 on Visual Studio 2022. Sometimes, when I start debugging, instead of starting the program it shows The application was unable to start correctly (0xc0000142). Click OK to close the application. If I close and reopen VS, it lets me start debugging again (at least for a while, until this message starts showing again). Any thoughts on why and if there is a way to fix it without have to close and reopen VS?

CodePudding user response:

This is a Visual Studio 2022 bug when you use Terminal as a default console.
If you close the opened console window while it's in a Console.ReadLine it crashes the program, and you can't open another instance for debugging unless you close and reopen vs.

  • Related