• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

isapi debug

发布: 2007-7-01 20:40 | 作者: admin | 来源: | 查看: 25次 | 进入软件测试论坛讨论

领测软件测试网  

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: 


MORE INFORMATION

Following are the steps for one method to debug an ISAPI Extension or Filter DLL. (It is assumed that Visual C++ is installed on the IIS computer.)

  1. 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).

  2. 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").

  3. Make sure that W3SVC service is running. Start it, if necessary (you can use this command: "net start w3svc").

  4. 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 ). You can attach a debugger to a particular process by right-clicking it within the Task Manager processes tab and choosing debug .

  5. In the list of running processes, select INETINFO .

  6. 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.

  7. Add your ISAPI extension or filter DLL to the list.

  8. 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);
 #endif
Also, 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


Published Apr 10 1998 4:17PM Issue Type kbhowto
Last Modifed Sep 12 2001 3:22PM Additional Query Words
Keywords kbASP kbDebug kbiis400 kbiis500


延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网