Resources for Troubleshooting ASP.NET Applications

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:

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

Pressing F12 in any browser should present a dialog that will allow you to see what is going on within your ASP.NET application. You’ll typically have access to a console to see any errors that may be present, Rion says. (You can also use the console to execute JavaScript or other commands.) A Network tab lets you monitor any requests that are being made. Rion says he relies heavily on Google’s Chrome DevTools for any JavaScript-, CSS- and HTML-related issues.

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.