It can be hard to debug crashes happening on live server running IIS or Kestrel. This PowerShell utility allows you to capture memory debug files that you can later open in Visual Studio or your favorite debugger.
w3wp.exe and dotnet.exe are supported.
There are two PowerShell files:
EnableDumps.ps1 // Enable crash capturingDisableDumps.ps1 // Disable crash capturing
- The
EnableDumps.ps1script will monitor your server in the background and wait for any crashes to occur. - Once a crash occur, the script will create a memory dump file in a folder of your choosing, e.g.
c:\dumps. - The
DisableDumps.ps1stops the monitoring process.
- Download both
.ps1-files and store them in e.g.c:\dumpson your server. - Open PowerShell, and issue the commands specified below.
To enable monitoring:
.\EnableDumps w3wp.exe c:\dumps
To disable:
.\DisableDumps w3wp.exe
To enable monitoring:
.\EnableDumps dotnet.exe c:\dumps
To disable:
.\DisableDumps dotnet.exe
- Also see procdump: https://learn.microsoft.com/en-us/sysinternals/downloads/procdump
- https://learn.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-7.0
- Visual Studio can be used to open the crash dump files: https://visualstudio.microsoft.com/