Solved

Debug.Print and Debug.Write no longer work in Visual Studio 2010

Posted on 2011-03-17
9
1,807 Views
Last Modified: 2013-11-27
Suddenly Debug.Print statements in my C# code are no longer being displayed in my Output window. I am running a Debug configuration of a simple Hello World C# Form application. "Project Properties/Build/Define DEBUG constant" is selected. Tools/Options/Debugging items are set to default values, including "Redirect all Output Window text . . ." cleared. I have made no app.config modifications (regarding TraceListeners or anything). I have relied on Debug.Print for years.  This problem occurs in all my projects now.

Not sure if this is relevant but when I step over the first Debug.Print statement, this shows in the Output window: " Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'

0
Comment
Question by:Tech_Dr
9 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 35160486
Debug statements appear in the 'Immediate' window.
Console statements appear in the 'Output' window.
0
 

Author Comment

by:Tech_Dr
ID: 35165253
@ Idle Mind. By default the output of Debug statements appear in the Output window, not Immediate window. Anyway I already examined the Immediate window and nothing shows up there either.
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 35165393
Your "default" is definitely different from my setup then...

I've been using many flavors of Visual Studio since version 2003 and, for me, it's always been the way I described.

I'm currently using VS2010 Premium.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 20

Expert Comment

by:hes
ID: 35165530
In the output window do you have
"Show Output From: Debug" selected
0
 
LVL 5

Assisted Solution

by:MedievalWarrior
MedievalWarrior earned 125 total points
ID: 35166894
The default installation doesn't display the "Immediate Window" by default only the "Output Window". If you need to show the "Immediate Window" just press CTRL+G in the IDE. You will want to do this two times once when your project isn't running (code mode) and again when you run your project.
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 35167118
I've always setup my Visual Studio with VB.Net as the default...wonder if this makes any difference?...
0
 

Assisted Solution

by:Tech_Dr
Tech_Dr earned 0 total points
ID: 35169163
Thanks for all comments and suggestions. I may have found the solution here:

http://www.dotnetmonster.com/Uwe/Forum.aspx/vs-net-debugging/1945/Trace-in-Output-Window-is-not-displayed

For a similar problem the MVP respondent says "- R-Click in Debug Output window and make sure that "Program Output" is checked."
I bet that's what it is. Most likely I must have accidentally unchecked this item without noticing. Will look on Monday when I get back to work.
0
 

Accepted Solution

by:
Tech_Dr earned 0 total points
ID: 35179950
There is a context menu in the Output/Debug pane. "Program Output" menu item was accidentally cleared. Works ok now.
0
 

Author Closing Comment

by:Tech_Dr
ID: 35221102
Own outside research led to solution.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question