Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6735389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:00:13+00:00 2026-05-26T11:00:13+00:00

Probably a copy of: Can I prevent an uncaught exception in another AppDomain from

  • 0

Probably a copy of: Can I prevent an uncaught exception in another AppDomain from shutting down the application?

Been trying all day to figure out the answer to this question.

Just want to make sure that the answer is indeed no, before I throw away all the code Ive made to isolate my drivers inside their separate appdomains and replace it with old-school processes.

So the formal question is this.

Having a default domain “ad-default”, in which I create a new appdomain “ad-hosted”, can I avoid that unhandled exceptions from “ad-hosted” tears down “ad-default”?

I am aware that I can observe the exceptions by hooking up to the UnhandledException event of the “ad-hosted” domain, but I can find no way to stop them from propogating to the “ad-default” domain.

Is this really true? But why would we even want AppDomain’s, if they do not provide isolation?

EDIT:
The answer is unfortunately NO, see this answer for explanation:
AppDomain, handling the exceptions

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:00:14+00:00Added an answer on May 26, 2026 at 11:00 am

    The only way to isolate the exceptions in a thread in another appdomain from tearing down the default domain is to use:

     <runtime>
        <legacyUnhandledExceptionPolicy enabled="1"/>
     <runtime>
    

    Which will set IsTerminating flag of the unhandledexception to false, and prevent the default domain from shutting down.

    What we did in our case was to hook up to the UnhandledExceptionHandler in both domains.
    We then trigger a semafore in in the “ad-hosted” that will be picked up by a thread created for this purpose in “ad-default”, which then in turn disposes the “ad-hosted”

    This is a hack and will probably not survive into future generations of the framework, but it makes “ad-default” more robust, in that it will not be torn down on unhandled exceptions in the “ad-hosted”

    we also hook up a eventhandler in “ad-default” that will cast sender as appdomain and check if the exception originated in “ad-default”, if so we tear down the “ad-default” too, emulating the behavior of .net 2.0, even with the runtime setting described above.

    Hope this gives somebody a clue on how to make a more resilent plugin host.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can copy a node from one XML file to another using org.w3c.dom.Document. importNode(Node
So I want to prevent people from copying files out of my app while
Are there any FTP programs which can automatically copy (or rather 'move') the contents
This is probably quite simple but I've googled and can't find an answer. I
Quick sanity check. Is Array.Copy for one dimensional arrays only, or can it handle
So from a glance at hackage I can see 5 pretty printing libraries: good
this is probably a newbie question regarding memory manegment. How can i release an
In an application I want to store sensitive data (which can be arbitrarily large)
this is probably something stupid, but i can't figure it out. I'm getting a
I know it probably a really easy question to answer but I trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.