Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Diagnostics.Debug.WriteLine() - not showing in output window 1

Status
Not open for further replies.

bbCincinnati

Programmer
Aug 21, 2008
14
0
0
US
PROBLEM: System.Diagnostics.Debug.WriteLine() doesn't display in the Output box.

SOLUTION: Close Visual Studio, and then re-open it.

ENVIRONMENT: Visual Studio 2005 / C#

DETAILS:

Hi Folks,

Earlier today, I could not seem to get the results of a line of code to display anywhere.

System.Diagnostics.Debug.WriteLine( "bla bla bla");

I tried:

View | Output

...and...

Debug | Windows | Output

Didn't work. (The Output box displayed, but my line of code did not cause anything to print therein).
In fact when I put a breakpoints on the line of code and "ran" it, the breakpoint either disappeared or moved to the line below. It was as though my line of code was not being seen. I "googled" the problem and saw that many people also had the same issue, but I didn't see any solution. What finally worked was to shut down Visual Studio, and re-open it. (Not just stop debugging and re-run). It seems kind of obvious now, but I wasted probably an hour monkeying with it.

I hope this helps someone in the future :eek:)
 
where you running in release mode? if so Debug.WriteLine() wouldn't output anything.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Hi Jason,
Thanks for the tip.
When I was having the problem, Visual Studio **said** it was in Debug mode.
However, after reading your tip, I tried manually putting it into Release mode to see if I could duplicate the previous problem.
Sure enough. I got exactly the same results. Just like you said, Debug.WriteLine() did nothing.
So, that makes me wonder if (when I was having the original problem) maybe it was in Release mode and only **said** it was in "Debug" mode.
Who knows.
Thanks again for the tip, now I'll know to watch out for that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top