Hi,
In a previous article, I was explaining how to generate a FREB log on a HTTP error or a long running request.
It's also possible to generate a dump based on the FREB rule, by example, when a request takes more than 15 seconds to be executed.
The major inconvenient is the need to make a choice between the FREB log and the dump. It's either one or the other, but not both at the same time.

Here is how to do it:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <tracing>
            <traceFailedRequests>
                <add path="*">
                    <traceAreas>
                        <add provider="ASP" verbosity="Verbose" />
                        <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
                        <add provider="ISAPI Extension" verbosity="Verbose" />
                        <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module" verbosity="Verbose" />
                    </traceAreas>
                    <failureDefinitions timeTaken="00:00:15" />
                </add>
            </traceFailedRequests>
        </tracing>
    </system.webServer>
</configuration>

If you hadn't authorized the delegation, you'll find the same configuration in the ApplicationHost.config file located in the folder "C:\Windows\System32\Inetsrv\Config".

  • To generate a dump, you need to precise to IIS you won't do the default action, actually generate a FREB log, but that you'll perform a specific action.
    There are two principal ways to do this:
    • The first one is to open the ApplicationHost.config
      1. Look for the tag <sites>
      2. And add to the web site you want to monitor customActionsEnabled="true" to <traceFailedRequestsLogging enabled="true" />
      3. Which will give you for the Default Web Site:

<sites>
    <site name="Default Web Site" id="1" serverAutoStart="true">
        <application path="/">
            <virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:80:" />
        </bindings>
        <traceFailedRequestsLogging enabled="true" customActionsEnabled="true" />
    </site>
</sites>

  • The second one is to use the appcmd.exe tool used to configure IIS with command-lines
    • Open a CMD console
    • Navigate to the folder "C:\Windows\System32\Inetsrv"
    • Then execute the following command-line: (/[name='x'] where x corresponds to the name of your web site)

appcmd.exe set config -section:system.applicationHost/sites "/[name='Default Web Site'].traceFailedRequestsLogging.customActionsEnabled:"true"" /commit:apphost

You should find exactly the same configuration than above in the ApplicationHost.config file.

  • To be able to generate a dump via a FREB rule, you need to install ADPLUS, which is available with the Debugging Tools for Windows:
  • The last step is to indicate the specific action we want to realize: generate a dump.

    This can be done in the Web.Config of your application, or directly in the ApplicationHost.config, in the section <system.webServer> <tracing> <traceFailedRequests>.
    You just need to add the following elements to <add path="*">:

    <add path="*" customActionExe="c:\windows\system32\cscript.exe" customActionParams="C:\Debuggers\adplus_old.vbs -hang -pn w3wp.exe -o c:\dumps -quiet" customActionTriggerLimit="50">

    • CustomActionExe corresponds to the executable we want to launch
    • customActionParams corresponds to the parameters passed to the executable
    • By default dumps will be generated in the folder C:\dumps but you can change this location by modifying -o c:\dumps

    You should get a Web.Config / ApplicationHost.config with a similar content:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <tracing>
                <traceFailedRequests>
                    <add path="*" customActionExe="c:\windows\system32\cscript.exe" customActionParams="C:\Debuggers\adplus_old.vbs -hang -pn w3wp.exe -o c:\dumps -quiet" customActionTriggerLimit="50">
                        <traceAreas>
                            <add provider="ASP" verbosity="Verbose" />
                            <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
                            <add provider="ISAPI Extension" verbosity="Verbose" />
                            <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module" verbosity="Verbose" />
                        </traceAreas>
                        <failureDefinitions timeTaken="00:00:15" />
                    </add>
                </traceFailedRequests>
            </tracing>
        </system.webServer>
    </configuration>

    For your information you can replace the star in <add path="*" by a specific page like "default.htm" or by example by a specific extension like "*.aspx".

Once all these configurations are saved, you only have to wait for the dump to be generated.

We hope this article will be useful for you.
Thank you very much to Finbar Ryan, who helped me to make this working.

See you soon
Sylvain Lecerf and the French Microsoft IIS Support Team