Posted by Leslie Ayers on Tuesday, November 19, 2013 - 05:00
We are human. We make mistakes. Even when developing ASP.NET applications.
When you locate a problem or a bug in your ASP.NET code — maybe something serious enough to generate the YSOD (yellow screen of death) — you’ll want to have the following troubleshooting resources on hand.
Visual Studio Debugger
If you use Microsoft Visual Studio to develop ASP.NET applications, do not overlook the debugger that ships with it, recommends ASP.NET veteran developer Rion Williams. The debugger helps you isolate and correct logic errors that prevent your application or Stored Procedures from running as they should.
Breakpoints and Tracepoints
Placing breakpoints in areas of your ASP.NET code that could be problematic and stepping through your code line by line to discern exactly what line a problem is stemming from and how to fix it can be a lifesaver, says Rion, who recommends checking out these resources from the Microsoft Developer Network:
- Overview of Breakpoints and Tracepoints
- Breakpoints in Visual Studio
- Debugging Visual Studio Applications
- How to Use Breakpoints in Visual Studio
The Watch Window
The Watch window can be helpful for debugging in Visual Studio, Rion says. It allows you to place dynamic values into the window and see values even outside of your current scope. For more, check out these resources:
Other Troubleshooting Tools
Rion keeps two additional tools in his troubleshooting kit:
- Fiddler is a free web debugging proxy for any browser, system or platform. “It can be an awesome tool for troubleshooting things like AJAX requests or any other web requests that you need to inspect Headers and other content (such as in a web API environment),” says Rion.
- Glimpse is a web debugger especially for ASP.NET MVC. It allows you to further inspect what type of data is being sent across your Controllers, information about the Models and what is being passed to the Views that you may not normally be exposed to.
Still in search of further resources? ASP.NET expert Scott Hanselman has collected a handy list of links to ASP.NET troubleshooting resources to help you debug your applications.