My project properties are
- Build/Configuration: Active(Debug)
- Build/Platform: Active(Any CPU)
- Build/Define DEBUG constant (Checked)
- Build/Define TRACE constant (Checked)
In my code I've tried this:
System.Diagnostics.Debug.AutoFlush = true;
System.Diagnostics.Debug.WriteLine(text);
and this:
System.Diagnostics.Trace.AutoFlush = true;
System.Diagnostics.Trace.WriteLine(text);
and in desperation I've added:
#define DEBUG
#define TRACE
I've opened my application.exe.config file, there are no <system.diagnostics> entries. Which I believe is correct as M$FT assures me that if TRACE and DEBUG are enabled, the listeners are automatically created.
And my Output window in the debugger shows "Show output from: Debug" and the context menu for the output window has "Program Output" checked.
Each of the above items is from various StackOverflow posts. I've read every post I could find related to this issue, which is quite a lot. I have added and removed the above elements in my code in methodical fashion in an attempt to cover all possibilities of combinations. Yes, I've been at this for hours.
I'm using Windows 10, VS 2015 in C#; all pretty standard stuff.
Is there something else to check?
I don't know if this is a clue or not but every time a trace or debug writeline is run I see this in the output window
The thread '<No Name>' (0x41d4) has exited with code 0 (0x0).
So, my output window generally looks like this.
The thread '<No Name>' (0x68f4) has exited with code 0 (0x0).
The thread '<No Name>' (0x6f58) has exited with code 0 (0x0).
The thread '<No Name>' (0xc260) has exited with code 0 (0x0).
The thread '<No Name>' (0xa87c) has exited with code 0 (0x0).
The thread '<No Name>' (0x80a4) has exited with code 0 (0x0).
The thread '<No Name>' (0xdb8c) has exited with code 0 (0x0).
The thread '<No Name>' (0xad44) has exited with code 0 (0x0).
The thread '<No Name>' (0x3b88) has exited with code 0 (0x0).
The thread '<No Name>' (0xcbb4) has exited with code 0 (0x0).
At first, I thought this output was related to all the async methods (we have a lot) but then I noticed they seem to happen on every trace/debug call.