09 January 2007

C#.Net Debugging to the Output Window

Finally I discovered that I can actually debug by outputting text to a window in VS.Net

To get your C#.Net script to output to the console, simply add:

System.Diagnostics.Debug.WriteLine("Hello!");


Do the Debug > Attach to Process > aspnet_wp.exe and visit the page.

Here is a screenshot of the results:

3 comments:

Anonymous said...

Wow, this is fantastic. I had no idea that I could output text to the debug / output / immediate window. This really helps when trying to debug AJAX applications that don't actually debug properly in ASP.Net anyway.

Thanks for this.

Anonymous said...

Interesting to know.

Anonymous said...

I wish VC++ had this >.>