×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Visual Basic (Classic) FAQ

ActiveX and DLL Creation

Is there a way to force a DLL to unload with IIS 4.0? YES! by bigfoot
Posted: 3 May 01

Is there a way to force a DLL to unload with IIS 4.0? YES!
 
You are developing a DLL in VB and testing with ASP.
When you use your dll in ASP, IIS keeps it in memory, and when you try to unload/delete the DLL from the server to
go back to VB DLL code and recompile or replace the old DLL with the new DLL, you get a "Sharing violation", because the dll is being held by IIS.

With IIS3 you could stop and restart the server and then recompile the component, but that does NOT work for IIS4.

Setting the object to Nothing in the VBScript code does not work.

There are 2 ways solve this:  
#1
Go to control panel / Services and stop the IIS admin service, but that stops the FTP service also.
Then you can start up the service again (don't forget to start up the FTP service).
No go into MMC and start the web server again.
This only takes a few minutes, but if your web site must be up all the time it is not acceptable.

BUT! There is a second way to do this: In MMC click on the folder your dll/app is in and go to properties for the folder.
In the Application settings part of the screen, click on Create.  You are going to create an application.  Give the app a name like the name of your folder or something - it does not matter.
Click the check box that says Run in separate memory space(isolated process)

Now when you want to recompile your dll, click the button in the same panel that says Unload, and your dll will be able to be overwritten.
You may have to do a regsvr32 (name) /u and re-register it, but it's better then bouncing the web server all the time.

I've been working on this problem for some time now, and I hope all can benefit from it

-Gary

Back to Visual Basic (Classic) FAQ Index
Back to Visual Basic (Classic) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close