Pergunta

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

Foi útil?

Solução

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

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

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top