Console, Debug, and Trace messages all seem to be displayed in the "Output" window, which is fine in most cases, but I'd like to have my Trace messages displayed separately (so they're not interleaved with everything else). Is there any way to do this without writing to a file/log?
To dock the Output window: Drag the title bar of the Output window to the left, right, top, or bottom edge of the InstallShield interface. To undock a tab on the Output window: Drag the tab to the new location.
Using the Call Stack Window To open the Call Stack window in Visual Studio, from the Debug menu, choose Windows>Call Stack. To set the local context to a particular row in the stack trace display, select and hold (or double click) the first column of the row.
Begin code stepping by selecting F10 or F11. Doing so allows you to quickly find the entry point of your app. You can then continue to press step commands to navigate through the code. Run to a specific location or function, for example, by setting a breakpoint and starting your app.
Sure, by default tracing writes to the Output window using the DefaultTraceListener, which is an implementation of the TraceListener class.
To write to a seperate output you'll need to either use one of the pre-supplied alternative TraceListener
s or implement your own (handling, at a minimum, Write()
and WriteLine()
; then register your listener in your configuration file.
There is only one option available in VS to get output in a different window: Tools + Options, Debugger, General, "Redirect all Output Window text to the Immediate Window". That however is not likely to do what you want it to do.
There are no good options available to get output into a VS window. The only mechanism is the Windows OutputDebugString() API function which lets the debugger see messages. That's already being used by the DefaultTraceListener. The Visual Studio hosting process supports redirecting Console.Write/Line() output to the Output window. The mechanism by which it works is unclear to me, other than that the hosting process is a custom hosted version of the CLR. Not something you'd want tackle, assuming it is even possible to replace it.
By far the most practical approach is to simply create your own window to display trace output, using your own trace listener. Easy enough to do with a Windows Forms form class that contains a multiline TextBox. How practical that is depends on the nature of your main EXE. Or trace to a file and use a file viewer that's smart enough to see updates to the file. I use Far.
Oh, and there's SysInternals' DebugView utility. It snoops on OutputDebugString() text.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With