Visual Studio output window is not displaying messages sent by Debug.Write()
Asked Answered
P

4

13

I am using Visual Studio 2010 Professional in trial mode... and suddenly the Output window won't show my Debug.Write() stuff. It had been showing it for the past month.

I have been using the 2010 version for 30 days (after upgrading from Visual Studio 2003) in trial mode. I just renewed the trial for the extra 60 days, and the "About Visual Studio" window says I still have 59 days left.

I have verified that the application is running properly, without errors. When I purposely generate an error, the Output Window properly shows the error and the stack trace I've already checked my Build>Configuration... it's in "Debug" mode, not "Release". The Debug.Write() text is not going to the Immediate window, either.

One other point, I tried running the same application in the Visual Studio 2010 Express Edition, and it complained that it could not debug the specified code, though it did properly build it so that it would run in the build. Could Visual Studio 2010 Express have modified something in my project files to disable the debugging output? I looked, but I really don't know what to look for.

Patrizius answered 26/2, 2011 at 18:35 Comment(1)
What is the Output window set to? It should be pointing at 'Debug', not 'Build' or 'Refactor'.Bazil
T
23

Same symptoms for me, different solution:

  1. Tools -> Options -> Debugging -> General
  2. Uncheck "Redirect all Output Window text to the Immediate Window"

After I did that, debug.print() went to the Output Window like it used to.

Weird that I never checked that option to begin with. Something I did must have caused the setting to change. No idea.

Terminable answered 28/8, 2011 at 18:20 Comment(1)
Had the exact same behavior, seemingly out of nowhere. Changing settings like kemida described fixed it.Fairleigh
C
3

There could be another reason the debug information is not showing in the Output window or the Immediate window. If your config file removes the default listener the debug information will not show. Comment out the remove default in the listeners section in your app.config file:

<trace autoflush="true" indentsize="4">
  <listeners>
    <!--<remove name="Default" />-->
  </listeners>
</trace>
Commodus answered 21/2, 2013 at 15:2 Comment(0)
B
1

Just an update regarding this issue I have as well because I change the filter setuptin the output windows. You need to right click in the Output window then select "PROGRAM OUTPUT" if it's not already selected.

Screenshot of the context menu on right click in the output window

Screen Shot

Beatrice answered 6/12, 2019 at 10:49 Comment(0)
L
0

Please take a look at this other question, which presents several possible reasons for your issue: Where does System.Diagnostics.Debug.Write output appear?

I would start by checking the DEBUG flag.

Labarum answered 26/2, 2011 at 18:53 Comment(5)
Thank, Julio, but that did not help.Patrizius
My Debug properties are :configuraiton: DebugPatrizius
Debug properties are Configurations:Debug; all the debuggers are checked; AdvancedCompile options are GenerateDebugINfo: full; I've tried "define DEBUG constant both checked and uncheckedPatrizius
I found the problem. It wasn't the Output window at all.Patrizius
In the configuration manager dialog box, in the "Project Contexts" list box, the last column is a check box labeled "Build". For some reason I must have unchecked that. Everything was right with the worlkd once I checked it again. Perhaps it <F5> was not re-building the program before debugging it?? And just running that last version of the code that I had actually built, not my recent changes. So <F%> was just ignoring the everything I had changed today, including the Debug.write statements???Patrizius

© 2022 - 2024 — McMap. All rights reserved.