Exception Hunter box shot

Exception Hunter

Walk-through

We are going to analyze a simple web application called Shovell, basic community-generated news site (inspired by Digg).

Step 1: Adding new assemblies or ASP.NET pages

When you open Exception Hunter, you will see a blank starting screen. The first thing to do is to add the .NET assemblies you want to analyze, by clicking on the Add Assembly button, or the Add ASP.NET Page button if you want to look at a web application. We will do the latter and add the file called Default. (Note that if an assembly references another assembly, it is added automatically.) Exception Hunter compiles the web application behind the scenes and opens its assembly.

Adding new assemblies image

Step 2: Locate the method you want to analyze

We are specifically looking for the method that generates the page and we know that it’s called Page_Load, so we navigate to it using the navigation bar above the grid.

Drill down to type level image

Step 3: Viewing the results

We're now on the results screen. On the left, we have the Unhandled Exceptions pane, on the right, the Stack Traces pane and below it the Source Code view.

We go through the exceptions on the left, and look for the ones that worry us, whilst eliminating those we are not concerned about.

Viewing the results image

When going through the list, we find that a security exception is thrown. We want to look into this further, so we click on System.Security.Security.Exception and drill down into the stack traces to investigate the different situations in which the exception is thrown. 

When we expand the third stack trace, we find that the Page_Load method calls FillMainArticle and as we can see in the source code, the FillMainArticle method opens a database connection, and that explains the possible exception.

Viewing the final results image


We therefore need to look more closely in the code and check in what situations the exception gets thrown. If it is a situation that is likely to happen, we need to write up some code to protect against the exception occurring.

$295

($369 including support & upgrades)

  • Download 14-day free trial
  • Create a quote for Exception Hunter
  • Add Exception Hunter to shopping cart
Feedback Form