How Do I Debug the Console Output?

T

TC

I'm trying to debug a console application, but I can't see the console
output. I've seen many references which say that console output is
supposed to appear on the Output window when the application is run in
Debug mode. However, I just can't get that to work.

I'm using Visual Studio 2005. I've confirmed that my application is
compiled as a console application, and that I'm running in Debug mode.
To investigate this issue, I've reduced the entire application to 5
lines:

Module Module1
Sub Main()
Console.Write("Test")
End Sub
End Module

Why don't I see "Test" on the Output window, and what must I do to see
it somewhere?


-TC
 
P

PvdG42

TC said:
I'm trying to debug a console application, but I can't see the console
output. I've seen many references which say that console output is
supposed to appear on the Output window when the application is run in
Debug mode. However, I just can't get that to work.

I'm using Visual Studio 2005. I've confirmed that my application is
compiled as a console application, and that I'm running in Debug mode.
To investigate this issue, I've reduced the entire application to 5
lines:

Module Module1
Sub Main()
Console.Write("Test")
End Sub
End Module

Why don't I see "Test" on the Output window, and what must I do to see
it somewhere?


-TC
Do you mean the console window? Console output will not be displayed in the
VS 2005 Output Window.
You need to add some code that will keep the console window open after your
write. As it is now, the application ends and the console window closes
before you see the output.
You could add a Console.Read() after the Write to pause your program to wait
for input to keep the console window open so you could see it.
 
M

Mr. Arnold

The only time I have seen a Console Application start directing output to
the IDE Output window was when the application was using threading. It was a
PITA as I never did figure out why it would start using the Output window
while I was debugging. I had to reboot the machine to make it go back to the
IDE and the DOS windows where I wanted to debug from.

The link may help

http://www.google.com/search?hl=en&q=redirect+console+application+output+.NET&btnG=Search
 
T

TC

The only time I have seen a Console Application start directing output to
the IDE Output window was when the application was using threading. It was a
PITA as I never did figure out why it would start using the Output window
while I was debugging. I had to reboot the machine to make it go back to the
IDE and the DOS windows where I wanted to debug from.

The link may help

http://www.google.com/search?hl=en&q=redirect+console+application+out...










- Show quoted text -

Thanks for the replies. Apparently, I was misinformed. I was told that
in Debug mode, Visual Studio somehow echoes the console output in a
Visual Studio window. Since that isn't the case, I will rely on other
debugging techniques.

-TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top