Automatically unload an ISAPI DLL from memory after usage


A very annoying circumstance, when testing a newly written ISAPI DLL, of IIS for WINNT 4 is that it keeps its DLL's cached in memory. There is no button or setting in IIS 3 or lower to change this. But when you make a slight change to your registry, every DLL that is called from your webserver is unloaded from memory after executing. This is extremely useful when checking if your DLL works properly. In this case you don't have to restart your webserver every time when copying a new DLL.

IIS 3 or lower:

Turn caching off change the following registry entry to 0:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\CacheExtensions

Restart the webserver to load the new registry entry and DLL's won't be cached anymore.

Don't forget to restore the default value (1) when going live.

IIS 4 or higher:

Right click on the script directory of your website. Select "properties" and on the "Virtual Directory" tab choose the "Configuration..." button. Deselect the "Cache ISAPI applications" checkbox and click twice on "Ok" to save the settings.