So I'm debugging a C# program in Visual Studio, and it launches a command window for Process.Start.

I want to keep this window open - however the method I tried - doing a Console.Readline(); didn't work.

Is there a standard way to keep a console window open so that I can see what happens when the program executes? It would be very helpful for debugging

有帮助吗?

解决方案

You could try with CMD.EXE and pass your program as argument

Process.Start("cmd.exe", "/K \"dir\"");

其他提示

Since you are using Visual Studio, I am not sure if Ctrl+F5 is what you are looking for... this keeps the console active.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top