Dynamic creation of object problem

  • Thread starter Thread starter Harry F. Harrison
  • Start date Start date
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.
 
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

Back
Top