Solved

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

Posted on 2011-03-17
9
1,900 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 86

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 86

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
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 
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 86

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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.   …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

631 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