0x49D1
0x49D1

Reputation: 8704

Debug.WriteLine is not writing output to OutputWindows in Visual Studio 2010

Tools|Options|Debugging Redirect all Output to Immediate is unchecked.
Tools|Options|Debugging|Output Window General output settings are all ON. Debug configuration is activated, define DEBUG constant is checked.

Still Debug.WriteLine("test") writes nothing to Output Window(Cant capture it in DebugView from sysinternals too). What can cause that?

Upvotes: 5

Views: 5346

Answers (4)

RayH1066
RayH1066

Reputation: 21

Just want to say for anyone coming to this question that the answer given and which received 0, System.Diagnostics.Debug.Listeners(0).WriteLine worked for me in VS2013. Change console.writeLine and or debug.WriteLine to the above , open your immediate window and output is there. Good luck

Upvotes: 0

user819490
user819490

Reputation: 125

or use this:

System.Diagnostics.Debug.Listeners(0).WriteLine

instead of just Debug.WriteLine

Upvotes: 3

Sith2021
Sith2021

Reputation: 3716

I fixed that problem closing the project, delete 'bin' and 'obj' folders. Reopen project and Debug.WriteLine works...

Upvotes: 1

0x49D1
0x49D1

Reputation: 8704

Had this in config file, hope that can help someone else:

<system.diagnostics>
    <trace>
      <listeners>
          <clear/>
      </listeners>
    </trace>
  </system.diagnostics>

removed clear, now everything works. Thank you @Hans Passant.

Upvotes: 2

Related Questions