Dynamic creation of object problem

H

Harry F. Harrison

Hi all...

During startup of an ASP.NET app, I have code that dynamically goes out and
loads assemblies, looking for objects that implement a particular interface.
This code works fine, EXCEPT, the objects do not get unloaded out of the
ASPNET_WP process when I end the application during debugging, and come back
to Visual Studio. I have to manually kill the ASPNET_WP process in order to
re-build the dlls, as they are locked - something that normally shouldn't
happen, but is.

Any ideas? I've thought about loading the objects into another AppDomain,
but it seems like a lot of extra work everytime I want to load objects
dynamically under ASPNET.
 
S

Scott Allen

Hi Harry:

ASP.NET makes a shadow copy of the assemblies it loads, that way
assemblies in the bin directory are never locked by the worker
process.

Using Assembly.Load to dynamically load an assembly does lock the
assembly. There is no way to unload an assembly from an app domain.
Unfortunately, using another application domain might be your only
option if you want to avoid cycling the worker process
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top