S
sam.m.gardiner
I have a service that used to be written using .net 1.1 and is now
using .net 2 with minimal changes. the service has a pluiggable
architecture that uses appdomains to do the loading/unloading of
resources. the issue I have is with AppDomain.Unload. Or at least, I
think that is the issue.
The service uses a file watcher to see when new plugins DLLs are
dumped.. it waits a bit using a timer to see if the new files have
stopped coming and then hits the Appdomain.Unload to get rid of the
old assemblies, copies the new files to another folder then loads
them. if the app has just started then the appdomain can be unloaded
with no problems. If it has been running for a while then the
appdomain.unload call fails and no exception is caught. I think I have
some problem with non-managed resources locking my appdomain as this
app is a dumping ground and calls into all kinds of stuff; homemade
DCOM stuff, MS office, crystal reports etc etc. Also, I am in a
multithreaded app, and I think that the threading has been done a
little bit crappily, is that going to have an impact? I know that
there are some posts on the web about having the unload call throw an
exception because of being unable to unwind threads.
I read on msdn that the .net 2 version didn't throw exceptions on
other threads, but this feels like that is what is happening..
using .net 2 with minimal changes. the service has a pluiggable
architecture that uses appdomains to do the loading/unloading of
resources. the issue I have is with AppDomain.Unload. Or at least, I
think that is the issue.
The service uses a file watcher to see when new plugins DLLs are
dumped.. it waits a bit using a timer to see if the new files have
stopped coming and then hits the Appdomain.Unload to get rid of the
old assemblies, copies the new files to another folder then loads
them. if the app has just started then the appdomain can be unloaded
with no problems. If it has been running for a while then the
appdomain.unload call fails and no exception is caught. I think I have
some problem with non-managed resources locking my appdomain as this
app is a dumping ground and calls into all kinds of stuff; homemade
DCOM stuff, MS office, crystal reports etc etc. Also, I am in a
multithreaded app, and I think that the threading has been done a
little bit crappily, is that going to have an impact? I know that
there are some posts on the web about having the unload call throw an
exception because of being unable to unwind threads.
I read on msdn that the .net 2 version didn't throw exceptions on
other threads, but this feels like that is what is happening..