Discussion Locked

COM objects in Visual Basic

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have created a COM DLL in Visual Basic and every time I make change to it and try to copy the new version to my web server I have to stop and restart IIS to get it to work -- otherwise the file is in use.

Anyone know a work-around for this? I'd rather not have to stop and restart IIS every time.

5 replies

by medievaldude

Unfortunately, there is no way around this. Once you register your DLL on the web server and then call it, IIS grabs onto the DLL and won't let go until you restart services. I was hoping Microsoft had fixed this problem with the latest version ofIIS that runs with Windows 2000, but it reacts the same way. It can be a real pain - especially if you don't have the security permissions to remotely access your server.
What I tend to do to compensate a bit for all of this is to create projects that contain a small Standard EXE and my new DLL (or new version of an old DLL). Then I just reference the DLL in my EXE and test its functionality within the VB environment at my desk to make sure it's ready for my web pages. Once I have my DLL registered on IIS, I at least feel confident that it will behave as it should. Hope that helps a bit.

by agibbs

Actually, I just found out that's not entirely correct -- if you unload the application (not remove, UNLOAD) from the website that last used the component, IIS lets go of the DLL so you can replace it.

Keep in mind, though, that if the site's application runs in a pooled process, all the applications in the pool are unloaded . . .

by matthew.alverson

Instead of registering your dll with the web server. I would recommend using the Microsoft Transaction Server (NT4) or Component Manger (win2k). It requires you to change the way you call the dll slightly or the component manager can create a registeration disk to run on the webserver. However when you want to update all you have to do is drag the dll from explorer into the console.

This discussion is closed to new replies.