There is a KB article about How to generate a dump file when ASP.NET deadlocks in IIS 6.0. Please refer to http://support.microsoft.com/kb/828222 . This is not only applied to deadlock issue in IIS 6. Some errors only happen in a production environment. Killing worker processes ensures up-time but troubleshooting of these errors becomes difficult, e.g. if the failing worker process needs to be debugged. The process orphaning feature in WAS allows worker processes to be recycled without killing the failed worker process. Now a debugger can be attached to it. Additional process orphaning settings allow the execution of a process (e.g. a debugger) if orphaning happens.
You can download and install Windbg by installing WDK according to your system version from the link as below.
@if "%_echo%"=="" echo off
set TIMESTAMP=%TIMESTAMP: =_%
set COMMAND=c:\debuggers\cdb.exe -c ".dump /o /ma %FILENAME%;q" -p %1
echo %COMMAND% > %LOG%
Note You may have to modify the location of the debuggers and the location where you want the resulting dump file to be generated.
For IIS 6, you can configure process orphaning as below.
Note: Replace the DefaultAppPool as the Problematic application pool name.
adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanWorkerProcess TRUE
adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanActionExe "c:\action.cmd"
adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanActionParams "%1%"
Note Make sure that the OrphanActionExe option points to the location of the batch file that was created in the "Create a Batch File to Execute When a Worker Process Is Orphaned" section. Also make sure that the identity of the W3wp.exe process has Read and Execute permissions to this file.
For IIS7 or above version, you can open IIS Manager to configure this feature directly.
1. Select your application pool and click Advanced Settings as below.
2. Then you can set the Process Orphaning parameters here.
Note Make sure that the Executable option points to the location of the batch file that was created in the "Create a Batch File to Execute When a Worker Process Is Orphaned" section. Also make sure that the identity of the W3wp.exe process has Read and Execute permissions to this file.
Charles from APGC DSI Team