Microsoft KB Archive/192754

= How to debug InProc COM components inside IIS using WINDBG =

Article ID: 192754

Article Last Modified on 5/29/2006

-

APPLIES TO


 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Services 5.0
 * Microsoft Active Server Pages 4.0
 * Microsoft Visual Studio 6.0 Enterprise Edition
 * Microsoft Visual Studio 97 Service Pack 3

-



This article was previously published under Q192754



SUMMARY
This article explains how to use WinDbg in case of an Active Server Pages (ASP) 'ASP0115 Access Violation' error during the execution of a custom component that is written in Visual C++ or Visual Basic.

You can use WinDbg to further debug the component to find the actual line of code that the component is failing on.



MORE INFORMATION
Install WinDbg from the Microsoft Platform SDK.

Follow the instructions below for running it. Turn off Code Optimization in your compiler and compile the debug version with the .pdb files. The debug symbols (.pdb files) for your custom component should be placed in the same folder as the .dll file, and when you use WinDbg make sure the source files for your component are available on the server. To use WinDbg, follow these steps:
 * 1) Install WinDbg from the Microsoft Platform SDK.
 * 2) Start WinDbg. From the Debug menu, click Attach to A Process. Select the correct Process ID (PID) from the Process List:InetInfo PID:

If the Web application is running in the same memory space as InetInfo, select Inetinfo.exe from the Process List.

MTX PID:

If the Web application has been set up to run in a separate memory space, the process will be an instance of Mtx.exe. There may be multiple instances of Mtx.exe in the Process List, so you can use one of the two methods outlined below to identify the appropriate process to attach to.
 * 1) * If the Web site is being hosted on a computer that is running Windows NT 4 with Service Pack 4, you can use the Script Debugger to obtain the processID of the appropriate instance of Mtx.exe. To do this, open the Script Debugger's Running Documents window. The root folder for each isolated application is listed, along with the processID of the appropriate instance of Mtx.exe.
 * 2) * If the Web site is being hosted on a computer running Windows NT 4 with Service Pack 3 or earlier, you will need to use a special utility to determine the processID. The IIS Resource Kit for IIS version 4.0 includes a utility called "GetPID" that you can use to identify the Process ID for an isolated application.
 * 3) From the Debug menu, click Exceptions, and then double-click Access Violation.
 * 4) Select Action = 'Enabled', and then click OK.
 * 5) Generate the Access Violation by connecting to the Web site.
 * 6) The dialog box will prompt you for the source code. Browse to the source code and then select either the .cls file or the .cpp file. The WinDbg debugger should now open another window, showing the line on which the component access violated highlighted in yellow.

