DebugView/OutputDebugString Lives in .NET

Back in my COM+ VB6 days I always had a tough time  to
debug into my VB6 components that were running in a dllhost (COM+ Server Application
environment). Basically when the call jumped into the component that was hosted
by COM+ , it would sometimes do funny things like hang the VB6 debug session.

So one method to help debug, was to use an api in the code called OutputDebugString in addition with a little application called DBWIN32.exe, to capture and display the OutputDebugString calls in the code.   
In a nutshell DBWIN32 is a little window that captures and displays any Win32 debug output.
So in the VB6 COM+ component code , basically when I needed to debug something I would put in the

OutputDebugString("I am debugging")

Then if the DBWIN32 window was up and running it would append to it's output:

July 7 2003 10:02:03    I am debugging

Does this work in .NET? -> Yes. But the nice thing about it is that you do not have to
use OutputDebugString API calls to add to the Win32 debug output.

Instead all I have to do is call something that I am sure you are familiar with such as:

System.Diagnostics.Debug.WriteLine("I am debugging"); or
System.Diagnostics.Trace.WriteLine("I am Tracing");

To try this out (if you haven't already, go ahead do it, you might find this useful later!) go to the following
site and download debugview :

This is not a full blown install, but only a zip file with a little exe in it. Once you have unzipped Dbgview.exe:

1) Run Dbgview.exe. The little DebugView window will be launched.
2) Create a new .NET windows or .NET ASP application.
3) Somewhere in the code put (make sure the code is called on startup)

System.Diagnostics.Debug.WriteLine("I am debugging");
System.Diagnostics.Trace.WriteLine("I am Tracing");

4) Compile it, (but make sure that it is the debug version).
5) Run the .exe (Windows) or navigate to the URL (ASP.Net) to run the debug version.
(Note if you are in VS.NET go to menu choice Debug/Start Without Debugging or
the VS.NET Output Window will grab the debug Win32 output)
6) In the Dbgview.exe output window you should see something like:

20 3:35:37  [3476] I am debugging
20 3:35:38  [3476] I am Tracing

Why is this useful? :

1) If you have not set up a listener for your Debug or Trace output, you will
not see the debug or trace output if your are running outside the VS.NET environment.
2) This is extremely useful for Biztalk 2004 debugging , but go here to
see why :
3) If you are bored you can always see what else is logging Win32 debug output.
4) For other Win32 debug output listeners and discussions go here :