LeanSentry Diagnostics guide

Debug production crashes in Visual Studio

Learn how to use LeanSentry Crash diagnostics to capture and debug your PRODUCTION-only crashes in Visual Studio ... just like you would for locally-reproducible crashes!

LeanSentry Crash diagnostics

What is a crash

A crash is an abnormal termination of the IIS worker process (w3wp.exe) due to an unhandled exception, stack overflow, or other critical failure. Crashes are a severe issue because they cause aborted requests, loss of state, and in some cases application downtime. Most APM tools do not detect crashes because the APM code inside the worker process terminates during the crash.

Because LeanSentry is external to your application, it can monitor and automatically diagnose production crashes in the IIS worker process (w3wp.exe) ... and any other process on your server.

Fixing a crash using LeanSentry Crash diagnostics

When a crash takes place in an important website, LeanSentry may notify you, directly including the code causing the crash in the email:

LeanSentry Crash notification

Click the link in the notification email to go to the Crash diagnostic report and see what caused the crash:

(Alternatively, you can select your website and go to it's "Crash diagnostics" tab to view all crashes LeanSentry detected for it.)

LeanSentry Crash report

The crash report provides enough information to fix most crashes, by providing:

  • The cause of the crash (stack overflow, unhandled exception, runtime error, etc)
  • The application code causing crash (or system code where the crash took place)

In some cases however, the crash stack trace may not provide enough information to a developer on WHY the crash took place. In that cause, a developer can use the crash dump associated with the LeanSentry Crash diagnostic report to reproduce the moment of the crash directly in Visual Studio. This way, the developer can inspect the state of application code in detail to figure out what led to the crash.

Debugging a production crash in Visual Studio

To debug production crashes in Visual Studio, follow these steps:

  1. Enable dump capture for Crash diagnostics.
  2. Mark a specific crash cause for dump capture.
  3. Locate a crash report and download the dump file.

Enable dump capture for Crash diagnostics

Open the Crash diagnostic settings and enable dump capture. You can select whether you'd like to save the dumps locally on the server, or to upload them to LeanSentry so your developers can download them.

Crash diagnostics settings Click "more settings" to view the dump capture settings. Dump settings for crash diagnostics

Note that by default, LeanSentry will only capture dump files for specific crashes you mark in the next step. This requires LeanSentry to observe a crash before your can enable dump capture. If you would like to capture dumps for all crashes, clear the "Save dump files for marked crashes only" checkbox.

Mark a specific crash cause for dump capture

Select one or more crash causes for which you'd like to capture dumps. You can also configure LeanSentry to capture dumps for ALL crashes by default, but be aware that this can increase the disk space and network overhead if you have a lot of crashes / if your process memory usage is large.

Crash cause dump capture settings

Locate a crash report and download the dump file

When a crash happens after you have configured dump capture for it, you'll be able to download the associated dump for local debugging.

Download crash dump file

NEW Debug dumps without symbols, sources, or DLLs

LeanSentry now provides the ability to set up your local dev environment for debugging production dumps even if you do not have matching sources, symbols, and DLLs. To learn more, see Debug production dumps without symbols, sources, or DLLs.

Debug crashes and errors in Visual Studio




More resources


Cannot use SAAS monitoring / need an on-premise solution?

Talk to us about LeanSentry On-Premise.

Want to automate LeanSentry deployment in a cloud environment?

Read this.

Need expert assistance with an urgent performance issue?

Get an quick consultation from one of our performance engineers.