Open the tool and click the Add Rule button and create a new Crash rule.

image

Next, select the target type.  Since I am debugging a SharePoint application, I know it is occurring in a single web application, so I choose “A specific IIS web application pool”.

image

I know that my SharePoint application uses the “SharePoint – 80” web application pool, so I choose that one.

image

In the next window, choose “Exceptions” from the Advanced Settings panel at the bottom of the window.

image

After you click the Exceptions button, you can configure a new Exception.  We want to capture a dump whenever a System.ArithmeticException occurs, so we choose Exception Code E0434F4D – CLR (.NET) 1.0 – 3.5 Exception from the list, and type System.ArithmeticException in the .NET Exception Type text box.  Finally, change the Action Type to Full Userdump so that a memory dump is created when the condition is met.

image

The next window allows you to name the rule and to configure the location where the userdump file is created.

image

The last window asks you if you want to activate the rule.

image

Once we configure the rule, you can see the rule and the number of userdumps that have been generated by the rule.

image

When I browse to the page, the exception is thrown, and DebugDiag sees the exception.  The Userdump Count column is incremented to 2 and the .DMP file is written to the directory that I configured.  Be mindful that the length of time required to create the dump depends on a few factors, including how much memory your process is consuming and how fast your disk is.

 

Looking at the directory, I can right-click on the file and see a new shell extension to Analyze Crash/Hang Issue.

 

image

 

DebugDiag runs for awhile, and generates a nice report letting me know what happened.

 

image

 

 

 

Advertisements