HOWTO: Debug InProc COM Components Inside IIS Using WINDBG

ID: Q192754


The information in this article applies to:


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 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 Platorm 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 directory as the .dll and when you use WinDbg make sure the source files for your component are available on the server. Here's how to use WinDbg:

  1. Install the 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 webapplication is running in the same memory space as InetInfo, you should select Inetinfo.exe from the Process List.

    MTX PID:
    If the webapplication 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.


  3. From the Debug menu, click Exceptions and select the following:
    1. Double-click Access Violation.


    2. Select Action = 'Enabled'.


    3. Click OK.


    4. Generate the Access Violation by connecting to the Web site.


    5. The dialog box will appear asking for the source code. Navigate to the source code and select the .cls or .cpp file.


    6. The WinDbg debugger should now open another window showing the line the component access violated on highlighted in yellow.





REFERENCES

Remote Debugging with WindDbg

Q177556 INFO: Articles on Remote Debugging with WinDBG
Q121543 Setting Up for Remote Debugging
Q170756 Available Switch Options for Windows NT Boot.ini File
Q148954 How to Set Up a Remote Debug Session Using a Modem
Q151981 How to Set Up a Remote Debug Session Using a Null Modem Cable
Q148659 How to Set Up Windows NT Debug Symbols
Q140718 PRB: Cannot Connect to WinDbgRm

Debugging Components

Q166275 HOWTO: Debug a Native Code Visual Basic Component in VC++
Q177182 Debugging a VB DLL under Active Server Pages
Q183480 Debug ISAPI and Filter DLL Under IIS 4.0

Additional query words: kbDebug


Keywords          : kbASP kbCOMt kbDebug kbGrpASP 
Version           : WINDOWS:6.0,97; winnt:4.0
Platform          : WINDOWS winnt 
Issue type        : kbhowto 

Last Reviewed: July 21, 1999