HOWTO: Debug Isapi Dlls Under IIS 4.0 and IIS 5.0 (Q183480)
The Information in this Article Applies TO:
Microsoft Internet Information Server 4.0
Microsoft Internet Information Services Version 5.0
SUMMARY Debugging of ISAPI Extensions and Filters under Internet Information Server (IIS) 4.0 is fully explained in the Microsoft Developer Network (MSDN) documentation This documentation can be found in the following location:. Platform SDK
Web Services
Internet Information SERVICES SDK
Programmer's Guide
Developing isapi extension and filters
Debugging ISAPI Extensions and FiltersPlease be aware that this documentation is not installed by the default installation option of NTOP or by adding IIS 5.0 to Windows 2000. However, it is available at the following link:
MSDN online
More Information Following Are The Steps for One Method To Debug An Isapi Extension or Filter DLL. (It is Assal C Is Installed on The Iis Computer.)
. Build a debug version of the ISAPI DLL By default, the Debug subdirectory of the project will now contain * .dll and two files with * .pdb extension (for example, c: / MyProj / debug directory). Create a virtual root with execute permissions in the IIS Management Console and 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 necessary (you can use this command: "net start w3svc").... Start Microsoft Developer Studio Go to the Build menu, click Start Debug, and click Attach Process Select the Show System Processes option In Windows 2000, sometimes No Processes Will Appear in The Process List (See Q235434 BUG: "Attach to Process"
List Is Empty). You can attach a debugger to a particular process by right-clicking it within the Task Manager processes tab and choosing debug. In the list of running processes, select INETINFO. From the Project menu, click Settings. Click the Debug tab. From the Category drop-down box, select Additional DLLs. At this point, you should see the message stating that DLLs symbols were loaded. Add your ISAPI extension or filter DLL to the list. From the File menu, click Open and bring . up the source file for the DLL Set a breakpoint in the source code and 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 Rebuilding the DLL should help in this situation NOTE 1:.. If the application is configured to run out-of-proc in IIS 4.0 (or on IIS 5.0 WITH Medium or High Application Protection), THEN Attaching Debugger to inetinfo .exe will not break execution of an Extension DLL. You will need to attach the debugger to the MTX.exe process (or DLLHOST.exe if using Windows 2000) that hosts the ISAPI DLL. Because there may be more than one MTX.exe (DLLHOST.exe) process running at one time, you may need to add code to the ISAPI DLL that shows the process ID (PID) that the DLL is loaded in. After the PID is known, you can attach the debugger to the MTX (Dllhost) with corresponding pid. You can use this code: #define _win32_winnt 0x0400 # ifdef _debug
Char szmessage [256];
WSPrintf (Szmessage, "Please Attach a debbuger to the process 0x% x
(% s) and click ok ",
GetCurrentProcessid (), Argv [0]);
MessageBox (Null, Szmessage, "Isapi / Filter Debug Time!",
MB_OK | MB_SERVICE_NOTIFICATION); # endifAlso, please note that medium Application Protection is a default setting of the IIS 5.0 NOTE 2: For debugging purposes it may be either to configure IIS 5.0 application to run with low Application Protection This will allow attaching debugger.. Directly to inetinfo.exe process. References Windows NT 4.0 Options Pack Online Documentation MSDN Online Documentation
Publishedapr 10 1998 4:17 PM Issue Typekbhowto Last Modifedsep 12 2001 3:22 PM Additional Query Wordskeywordskbasp Kbdebug KBIIS400 KBIS500