2

The text sent is not seen in the Output window.

Solution Configuration is Debug.

Output window is showing output from Debug.

It's a simple command: Debug.WriteLine("abc");

Setting a Breakpoint on it succeeds, but the program breaks on the line after it, moving the Breakpoint!

Changing Platform from Any CPU to x86 solves the issue. But going back, it returns.

Creating a new solution, it does work. Even in Any CPU.

I removed the .suo file for the solution.

I emptied the %temp% folder.

Is there any solution for this?

ispiro
  • 26,556
  • 38
  • 136
  • 291
  • Do you have the "Redirect all Output Window text to the Immediate Window" option checked in the Debugging options? – Cody Gray - on strike Jan 26 '12 at 19:33
  • No. And now I tried that and it didn't appear there either. – ispiro Jan 26 '12 at 20:14
  • 1
    Take a look at my solution http://stackoverflow.com/questions/5992094/debug-writeline-stops-working/12931631#12931631 [1]: http://stackoverflow.com/questions/5992094/debug-writeline-stops-working/12931631#12931631 – onmyway133 Oct 17 '12 at 09:58

1 Answers1

0

1) Go to Build -> Configuration manager and make sure you are in Debug mode, not Release. 2) Right-click on the project that you're having trouble with and choose properties. 3) Check the Build tab and make sure Define DEBUG constant and Define TRACE constant are both checked.

Note, most people make the mistake corrected by Step #1. But in my case it was steps #2 and #3 that fixed the problem. Despite being in DEBUG mode, for some reason those two constants were not being defined! I think the IDE may have turned them off when I had some of the projects in a solution using one platform target, and the rest of them using a different one, because by default, they are both enabled (checked) when you are in Debug mode.

Robert Oschler
  • 14,153
  • 18
  • 94
  • 227