Updating a VB6 DLL on the Web Server

Updating a VB6 DLL on the Web Server

Question:
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.

Answer:

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:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes