- Build a debug version of the ISAPI DLL. By default, the Debug subdirectory of the project will now contain *.dll and two files with a *.pdb extension (for example, c:\MyProj\debug directory).
- Create a virtual root with execute permissions in the IIS Management Console, and then set its physical location to the project's Debug directory (for example, /MyProj virtual root will be mapped to c:\MyProj\Debug).
- Make sure that W3SVC service is running. Start it if it is not (you can use this command: net start w3svc).
- Start Microsoft Developer Studio. On the Build menu, click Start Debug, and then click Attach Process. Select the Show System Processes option. On a Microsoft Windows 2000-based computer, sometimes no processes will appear in the process list.
For additional information about this issue, click the following article number to view the article in the Microsoft Knowledge Base:235434 FIX: "Attach to process" list is emptyTo attach a debugger to a particular process, click the Task Manager processes tab, right-click the process that you want, and then click debug.
- In the list of running processes, select INETINFO.
- On the Project menu, click Settings, and then click the Debug tab. In the Category list, click Additional DLLs.
At this point, you should see the message that states that the DLL symbols were loaded.
- Add your ISAPI extension or filter DLL to the list.
- On the File menu, click Open, and then bring up the source file for the DLL. Set a breakpoint in the source code, and then submit a request to IIS from the browser (for example, http://server/myproj/mydll.dll). If the debugger beeps and refuses to set the break point, the reason for this may be a mismatch between the DLL and PDB files. Rebuild the DLL to troubleshoot this situation.
#define _WIN32_WINNT 0x0400
char szMessage ;
wsprintf (szMessage, "Please attach a debugger to the process 0x%X and click OK",
MessageBox(NULL, szMessage, "ISAPI/Filter Debug Time!",
If you run IIS 6 in Worker Process Isolation Mode, extensions and filters are loaded by W3wp.exe. To debug an ISAPI Extension or a filter DLL in Microsoft Visual C++ .NET, follow these steps:
- Click Start, click Run, type Cmd, and then click OK.
- At the command prompt, type net stop W3svc, and then press ENTER.
- Open your ISAPI Extension or a filter DLL project in Visual C++ .NET.
- On the Project menu, click Properties.
- Click Debugging, and then type the path to the W3wp.exe file on your computer in the Command box.
- Type -debug in the Command Arguments box, and then click OK.
- Set the breakpoints in the project.
- On the Debug menu, click Start.
Note that this documentation is not installed by the default installation option of NT Option Pack or by adding IIS to Windows 2000 or Windows XP. To obtain this documentation, visit the following MSDN Web site:
Internet Information Services (IIS)
Internet Information Services 5.1
Developing ISAPI Extension and Filters
Debugging ISAPI Extensions and Filters
Article ID: 183480 - Last Review: Nov 13, 2008 - Revision: 1