INFO: Tips to Help You Debug ISAPI Extensions (328961)



The information in this article applies to:

  • Microsoft Windows CE .NET 4.2
  • Microsoft Windows CE .NET Operating System 4.1
  • Microsoft Windows CE .NET Operating System

This article was previously published under Q328961

SUMMARY

Debugging ISAPI extensions on a Web server can be complex. This article discusses how to simplify the debugging process.

MORE INFORMATION

This section discusses the following procedures:
  • Set up virtual roots
  • Refresh the Web server

Set Up Virtual Roots

On Microsoft Windows CE .NET 4.0 and later versions, the flat release directory where image binaries are placed is mapped on the Windows CE device under the \Release directory of the root directory.

Load the Extensions

Instead of having to copy Internet Server API (ISAPI) extensions to the device (as described later in this section), you can have ISAPI extensions loaded from the \Release directory. This convenience means that you do not have to rebuild and download new images and components when only the extension DLL changes.

To load ISAPI extensions from the \Release directory, modify the ISAPI extension registry entries. Use one of the following methods:
  • Method 1: Register a specific ISAPI extension DLL for the virtual root (VROOT):
    [HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS\/MyIsapi]
        @="\\release\\myisapi.dll"
    				
    Requests to HTTP://CE/MyIsapi are routed by the Web server during the first request directly to the ISAPI extension DLL that is located in the flat release directory.
  • Method 2: Register a directory for the ISAPI extension DLL for the VROOT:
    [HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS\/MyIsapi]
        @="\\release"
    				
    The \Release directory is just one of the directories under the virtual roots directory. You can access the ISAPI extension DLL by means of HTTP://CE/MyIsapi/Myisapi.dll.

Copy the Extensions

If you use the following VROOT configuration, the Web server loads only the DLL if the DLL is in the \Windows directory. This configuration requires you to copy the ISAPI extension DLL to the device after each recompilation. (Therefore, the "Load the Extensions" method that is described earlier is preferred.)
[HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS\/MyIsapi]
    @="myisapi.dll"
				

Refresh the Web Server

When you rebuild the ISAPI extension, the Web server must unload the previous extension. The previous extension must be unloaded before you recompile; otherwise, a file access conflict may occur, or the changes may not take affect because the DLL is in use.

To make the Web server unload all ISAPI DLLs, run the following command:

services refresh HTP0:

You can run this command from a Telnet session, from a command prompt, or from the remote shell in Platform Builder. When you refresh the Web server, the Web server stops accepting connections. After all connections have been terminated, the Web server unloads all ISAPI extensions. Then you can recompile and update the ISAPI extension.

Modification Type:MajorLast Reviewed:11/26/2003
Keywords:kbOEM kbDebug kbISAPIExt kbhttp kbinfo KB328961 kbAudDeveloper kbAudOEM