HOWTO: Lifetime of a COM Component Under IIS, ASP, and RDS

Last reviewed: September 30, 1997
Article ID: Q166279
The information in this article applies to:
  • Microsoft Internet Information Server version 3.0
  • Microsoft Active Server Pages version 1.0b

SUMMARY

When you create your own ActiveX Server components running under Internet Information Server (Inetinfo.exe) for Active Server Pages (ASP) or Remote Data Service (RDS), you may get the following error message when you try to recompile or overwrite your DLL:

   Permission Denied

What you are encountering is a caching feature of Internet Information Server (IIS) that improves performance by keeping the DLL in memory for subsequent calls. IIS loads the DLLs, such as your ActiveX DLL, and holds onto them--even long after you have navigated to another page. Though your ActiveX DLL instance is released after the method returns, the DLL with the class factory for the object is still loaded in memory, making it impossible to overwrite or recompile.

With version 1.5, the RDS has been renamed and merged with ActiveX Data Objects (ADO) to provide data remoting within the same programming model as ADO. Formerly, the Remote Data Service was known as the Advanced Data Conenctor (ADC). To clarify the relationship of ADC to ADO, ADC is now known as the Remote Data Service (RDS), a feature of ADO.

MORE INFORMATION

The best way to flush this DLL cache is by stopping your WWW service by going into the Internet Service Manager, right-click the WWW service, and select Stop. This can also be done by typing the following command at the Windows NT Command Prompt:

   Net Stop W3SVC

Then you can recompile or overwrite your DLL and restart your service by right-clicking on the WWW service, and selecting Start, or by typing the following command at the NT Command Prompt:

   Net Start W3SVC

To completely unload Inetinfo.exe you need to stop MSFTPSVC and GOPHERSVC, but you do not have to do this if you just want to unload your ActiveX DLL component.

If you want to make restarting the WWW service considerably faster on a development IIS server, create the following value in the registry, of type REG_DWORD, and set it to zero:

   HKEY_LOCAL_MACHINE
    \SYSTEM
     \CurrentControlSet
      \Services
       \W3SVC
        \Parameters
         \EnableSvcLoc

Do the same for MSFTPSVC and GOPHERSVC if you are running them.

NOTE: On a production server the service locater should be enabled by setting the value to one.

REFERENCES

Web site for RDS: http://www.microsoft.com/rds

Web site for IIS: http://www.microsoft.com/iis

RDS newsgroup: microsoft.public.rds

IIS newsgroup: microsoft.public.inetserver.iis

ASP newsgroup: microsoft.public.inetserver.iis.activeserverpages

ASP Roadmap: http://LocalServer/iasdocs/aspdocs/roadmap.asp

(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Jon Fowler, Microsoft Corporation

Keywords          : iisMisc
Version           : 1.0b 1.5 3.0
Platform          : NT WINDOWS
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.