We often need to capture memory dumps to investigate issues. I am sharing below guide to collect memory dumps using DebugDiag :
Pre-requisites :
- Download DebugDiag (download)
- Windows 2008 and higher
There are 2 ways to capture FIRST CHANCE EXCEPTION memory dumps of a process.
- Method 1: Generate a dump for all First Chance Exception
Or - Method 2: Target a specific First chance exception (Recommended)
Method 1: Generate a dump for all First Chance Exception
-
Launch DebugDiag
-
In the Rules tab select Crash and click on Next.
-
In “Select Target Type” select “A specific process” and click on Next.
Note: If the target is a web application hosted on IIS then, choose either “All IIS/COM+ related processes” or “A specific IIS web application pool”.
-
In “Select Target” select the target process and click on Next.
-
In “Advanced Configuration (Optional)” under “Unconfigured First Chance Exceptions” set the following:
Action type for unconfigured first chance exceptions: Full Userdump
Action Limit for unconfigured first chance exceptions: 10 -
Click on Next twice and then click on Finish to activate the rule.
Method 2: Target a specific First Chance Exception (Recommended)
Refer the instructions in Method 1 until step 5. After that refer the below instructions. For the purpose of this post, we will use StackOverflowException.
-
In “Advanced Configuration (Optional)” click on the Exceptions… button :
-
In “First chance Exception Configuration” click on “Add Exception…”
-
In “Configure Exception” select the CLR Exception from the LHS and since we are targeting StackOverflowException, specify the details as shown below:
.NET Exception Type: System.StackOverflowException
Action Type: Full Userdump
Action Limit: 5 -
NOTE: The Exception type is case sensitive. Ensure it is entered correctly.
-
Click on Ok and then click on “Save & Close”.
-
Click on Next twice and then click on Finish to activate the rule.




