Running IIS as a Process

In some cases, you may not be able to use either of the procedures in the preceding topic. If you have difficulty using these strategies, you can run IIS as a process (rather than as a service). This approach requires the establishing of Windows NT security privileges as well as making changes to the registry. It also disables your ability to run IIS as a service. This approach should be attempted only if the two strategies in the preceding topic have failed.

To run IIS as a process

  1. Use the User Manager for Domains administration tool 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 Windows NT account you will use when debugging the ISAPI extension.
  2. Use the Distributed COM Configuration utility to change the identity of the IIS Admin Service to the user account you will use for debugging.
  3. Use the Registry Editor to remove the LocalService keyword from all IISADMIN-related subkeys under HKEY_CLASSES_ROOT/AppID. This keyword can 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 also be found in additional subkeys of AppID.
  4. Add LocalServer32 subkeys to all IISADMIN-related subkeys under the CLSID node of the registry. This will include subkeys corresponding to all of the subkeys you removed in the previous step. Set the default value of these new keys to path\inetinfo.exe -e w3svc. (path is normally C:\Winnt\System32\Inetsrv.)
  5. Stop the WWW and FTP services from the Microsoft Management Console, or from the Services dialog box in Control Panel.
  6. Start Visual Studio and click the Debug tab in the Project Settings window.
  7. Type C:\Winnt\System32\Inetsrv\inetinfo.exe in the Executable for debug session box.
  8. Type -e w3svc in the Program Arguments box.
  9. Click the Link tab in the Visual Studio Project Settings window.
  10. Enter the name and path of the ISAPI extension you are debugging in the Output file name box.
  11. Optionally, add your component DLL to the list of additional DLLs that are loaded before the application starts. This will allow you to set breakpoints in component startup code.
  12. Click Go to start the debugging session.

Note  Additional instructions and two .reg files that automate the process of switching IIS between running as a service and running as a process are available in the SDK documentation included with IIS 4.0 in the Windows NT 4.0 Option Pack.