Establishing a
Debugging Environment
for IIS 4.0 ISAPI Applications
The following document was provided by Microsoft. I'm reposting it with the
final solution that worked for me with minor corrections to the original as well as a pair
of .REG files to set and unset the registry for debugging.
Rick Strahl - http://www.west-wind.com/
This method allows debugging IIS directly from the VStudio environment, where
you can simply run IIS from the Debug menu and then set breakpoints on your code when it
gets called. Although, there are mechanisms for attaching to the INETINFO service
directly, this is tedious as hell and causes IIS to go unstable, so I prefer the method
outlined below.
This approach requires the establishing of NT security privileges as well as
making changes to the registry. It will also disable your ability to run IIS as a service
unless you reverse the registry settings. Two registry files (one to set and one to unset)
that automate the registry hacks can be downloaded from http://www.west-wind.com/files/IIS4Debugging.zip
.
- Use the User Manager for Domains administration tool (USRMGR) to add the Log
on as Service, Act as part of the operating system and Generate security
audits rights on the local computer to the NT account you will use when debugging the
ISAPI extension.
- Use the Distributed COM Configuration utility (DCOMCNFG from the Run menu) to
change the identity of the IIS Admin Service to the user account you will use for
debugging.
Note: Steps 3 and 4 can be replaced by using the k2Process.REG file
from above
- Use the Registry Editor (REGEDIT) to remove the LocalService keyword from all
IISADMIN-related subkeys under HKEY_CLASSES_ROOT/AppID. This keyword may be found in the
following subkeys:
{61738644-F196-11D0-9953-00C04FD919C1} // IIS WAMREG admin Service
{9F0BD3A0-EC01-11D0-A6A0-00A0C922E752} // IIS Admin Crypto Extension
{A9E69610-B80D-11D0-B9B9-00A0C922E750} // IISADMIN Service
The LocalService keyword may be found in additional subkeys of AppID.