Solved

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

Posted on 2011-03-17
9
1,750 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
Comment Utility
Debug statements appear in the 'Immediate' window.
Console statements appear in the 'Output' window.
0
 

Author Comment

by:Tech_Dr
Comment Utility
@ 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
Comment Utility
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
 
LVL 20

Expert Comment

by:hes
Comment Utility
In the output window do you have
"Show Output From: Debug" selected
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 5

Assisted Solution

by:MedievalWarrior
MedievalWarrior earned 125 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Own outside research led to solution.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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.   …
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now