Updating a VB6 DLL on the Web Server

We have Internet Information Server (IIS) 4.0 running Active Server Pages (ASP) with a Visual Basic 6.0 DLL serving data content to the ASP pages. The problem lies when we try to update the DLL on the Web server with a new version, it appears to always be in use and therefore we are unable to upload and re-register a new version. We have shutdown the Web site and also IIS but the DLL is still in use. The only way to clear this is to shutdown the server. As you can imagine, when the site is live, shutting down the box is not really an option. Do you know of a solution to this problem? There is a useful 16-bit utility named WPS which allows DLLs to be closed, however, it doesn’t appear to work with VB6 DLLs.


The reason you are unable to update is because Microsoft Transaction Server (MTS) has the instance of the DLL open. You need to use the utility mtxstop to unload it. First, create a batch file called FlushCache.bat. In the batch file, create these lines:

net stop iisadmin /ymtxstopnet start w3svc

Run the batch file. It will bring down your Web site and bring it back up instantly within about five seconds or so. In between bringing it down and back up, it will also clear the MTS cache. You should then be able to update your DLL.

When you run the batch file for the first time, notice what other services are also stopped (for example, FTP Publishing Service and so forth). Keep a list of them. Then go back to the batch file, and add new lines to start those services back again using:

net start 

Update 6/3/00: Bill Bassett suggested this alternative solution:

An easier way to get around the problem of trying to rewrite a DLL is to set up the application so that it runs in its own separate memory space. Using the IIS MMC, right click the virtual directory containing your application. Next, select Properties. In the Application Settings area in the middle of the properties page, then enter a name for the application and check the box to Run in a separate memory space.

Once the application is running, by bringing up the properties page again, the Unload button will be available. When you press the unload button, the application unloads, and you can rewrite the DLL. This won’t de-register the DLL, so you may have to do that and the register of the DLL by hand, using regsvr32. It beats having to stop and restart IIS and other services each time.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may

man on floor with data

DevX Quick Guide to Data Ingestion

One of the biggest trends of the 21st century is the massive surge in internet usage. With major innovations such as smart technology, social media, and online shopping sites, the internet has become an essential part of everyday life for a large portion of the population. Due to this internet

payment via phone

7 Ways Technology Has Changed Traditional Payments

In today’s digital world, technology has changed how we make payments. From contactless cards to mobile wallets, it’s now easier to pay for goods and services without carrying cash or using a checkbook. This article will look at seven of the most significant ways technology has transformed traditional payment methods.