Hello rjh,
Sorry, but .NET 2.0 CLR design is that the most of exeptions leads to appdomain
unloading, albeit UnhandledException and ThreadAbortException are being
notified.
But, u can use legacyUnhandledExceptionPolicy flag of runtime version to
return the 1.1 behaviour
Read more about this there
http://msdn2.microsoft.com/en-us/library/ms228965.aspx http://msdn2.microsoft.com/en-us/library/ms228965.aspx r> Thanks for the reply. I understand that I can load/unload the
r> appdomain. The problem is this: The DLL's that I am loading/unloading
r> are "plug-ins" to our main app. There could be hundreds of these, and
r> most are third party. Some create their own threads. If there is an
r> exception in one of their threads, and they don't handle it, my
r> application gets an UnHandledException event and my application dies.
r> This obviously is not acceptable. I need to way to totally isolate
r> these plug-ins. It looks like AppDomains is not going to work for me?
r>
r> -Rich
r>
[quoted text, click to view] r> "Michael Nemtsev" wrote:
r>
>> Hello rjh,
>>
>> You can't unload specific assembly.
>> just unload/load whole appdomain
>> r> I use application domains to load third party DLL's. Ideally, if
>> one
>> r> of these DLL's throws an exception, I do not want the exception to
>> r> take down my application. It seems that Application Domains are
>> r> designed to isolate code. I have researched quite a bit on this
>> and
>> r> there does not seem to be a way to detect an exception in an app
>> r> domain and report this error. What I want to do is report the
>> error,
>> r> unload the DLL, then re-load it again. I can detect the error with
>> r> the UnHandledException handler in my main app, but by then its to
>> r> late, my app will then quit. Am I stuck? This is with .NET 2.0.
>> r>
>> ---
>> WBR,
>> Michael Nemtsev [C# MVP] :: blog:
http://spaces.live.com/laflour >> "At times one remains faithful to a cause only because its opponents
>> do not cease to be insipid." (c) Friedrich Nietzsche
>>
---
WBR,
Michael Nemtsev [C# MVP] :: blog:
http://spaces.live.com/laflour "At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch