Using the Debug Class
During the testing of your application, you may find that when you are stepping through code the application works fine, but when you run the program straight through it does not work the way you expected. The reason for this is that you can change the way your program runs by using the debugger—the fact that you're executing the code extremely slowly can affect the behavior of the application! Instead of using the debugger to test values, you may find it convenient to print those values to the Immediate window.
You may print directly to the Output window (use the View, Other Windows, Output menu item to display this window and select Debug from the drop-down list at the top of the window) from within your application by ...
Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.