The only way to isolate exceptions in a thread in another appdomain from a default domain break is to use:
<runtime> <legacyUnhandledExceptionPolicy enabled="1"/> <runtime>
which sets the IsTerminating flag for unhandledexception to false and will not disable the default domain.
In our case, we decided to connect to the UnhandledExceptionHandler in both domains. Then we run semafore in in the "ad placement", which will be picked up by the stream created for this purpose in "ad-default", which then, in turn, places the "ad placement"
This is a hack and probably will not survive in future generations of the framework, but makes it "ad-default" more reliable, since it will not be broken into unhandled exceptions in the "posted ad"
we also attach an event handler in "ad-default", which will send the sender as appdomain and check if an exception occurred in "ad-default", if so, we also destroy the "default declaration", emulating .net 2.0 behavior, even with the runtime setting described above.
Hopefully this will give someone a hint on how to make a more flexible host plugin.
Casper Leon Nielsen
source share