Search code examples
debuggingconsolevisual-studio-2022

How to disable the console hiding when I start debugging a .NET project in Visual Studio?


How can I stop the console from hiding when I start debugging a .NET project in Visual Studio?

Tools → Options → Debugging → "Automatically close the console" is not doing what I want.

Are there any other settings I should use?


Solution

  • The option is "Automatically close the console when debugging stops". But you want to hide console when start debugging, you can try these method:

    1.Change Output type to Windows Application in properties:

    enter image description here

    2.Add this code in the project:

    This method will hide the console window when starting debugging.

    Here is my test result:

    enter image description here

    You can get more information from here.