Using DebugView to catch debug output of .NET program

Often asked question: is there any way to gather debug output of .NET program that is running on environment where Visual Studio is not installed? Yes, you can do it and you can do it for free with program called DebugView. Here’s how it works.

After downloading and unzipping DebugView you can run it and select debug output options. I suggest you to run it as Administrator because otherwise it may state that there is already debugger up and running when you try to check Capture Global Win32 option.

DebugView capture options

DebugView starts listening immediately. As a next thing I will write some debug information to my code. This is one of my action methods in very early state and it’s safe to play with it.

public ActionResult Index(int page = 1)
{
   
Debug.WriteLine("HomeController.Index: started, page="
+ page);

   
PagedResult<Event
> events;

   
using (var model = new EventsEntities
())
    {
        events = model.ListPublicEvents(page);
    }

   
Debug.WriteLine("HomeController.Index: finished"
);
   
return View(events);
}

Now let’s run the code and see what DebugView is able to catch. Don’t run the code through Visual Studio as it attaches its own debugger and DebugView is not able to catch the output then.

DebugView debug output

Besides log messages you can also see how much time it takes to move from one debug output to another. If you have lengthy output then you can also use find functionality to search for specific log messages.

Liked this post? Empower your friends by sharing it!

Gunnar Peipman

Gunnar Peipman is ASP.NET, Azure and SharePoint fan, Estonian Microsoft user group leader, blogger, conference speaker, teacher, and tech maniac. Since 2008 he is Microsoft MVP specialized on ASP.NET.

    4 thoughts on “Using DebugView to catch debug output of .NET program

    • May 21, 2011 at 12:39 pm
      Permalink

      Have you tried that with .NET 4.0 apps? In my case it deosn’t work with .NET 4 which is really shame because I really like DbgView

    • May 30, 2011 at 9:04 pm
      Permalink

      Does not work.
      It catches some stuff from Visual Studio, but nothing from my app :(

    • June 2, 2011 at 11:37 am
      Permalink

      Activate more debug info resources from Capture menu.

    Leave a Reply

    Your email address will not be published. Required fields are marked *