How to UNLOAD an Assembly after you LoadFile(...)??

M

mdb

I'm trying to develop an application who's GUI will be changing frequently,
used by hundreds of people in a corporation.

In order to support this, I've created a small .NET web page that loads the
assembly, grabs the version number, and reports it in an XML document to
the client (a .NET stub loader application). The stub application compares
the version reported in the XML to the version of the DLL that it has, and
if the reported version is newer, it downloads the file and executes the
appropriate code.

My problem is that the ASPX web page, after loading the assembly, doesn't
release the file lock. In order to update the DLL, I have to restart the
IIS services. If I don't do this, I can't delete it because the web server
still has the file locked.

How can I unload the assembly once its been loaded??

(Please.... no comments on the philosophy of a frequently changing GUI -
I have my reasons for doing this.)

Thanks!!

-mdb
 
M

Marina

As far as I know, there is no way to do this.

What I have done before, is read the bytes of an assembly file into a byte
array, and then create an assembly object from that byte array. That works
without the lock on the file, since it is released when the filestream is
closed.
 
M

mdb

Marina said:
What I have done before, is read the bytes of an assembly file into a
byte array, and then create an assembly object from that byte array.
That works without the lock on the file, since it is released when the
filestream is closed.

Worked wonderfully! Thanks!

-mdb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top