4
votes

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?

4
Document your question better. What happens when you create a new project? What's in the .exe.config file? What happens when you turn on unmanaged debugging?Hans Passant

4 Answers

3
votes

or use this:

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

instead of just Debug.WriteLine

2
votes

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.

1
votes

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

0
votes

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