This project has moved and is read-only. For the latest updates, please go here.

Isolating Parts Process

Mar 9, 2010 at 11:48 AM


I'm using MEF a lot these days, and quite enjoyed it until now. I have an application which loads some components at startup. The thing is, my application should be able to host 3rd part component which could throw an exception which isn't handled by the component itself. I don't want my application to crash when it happens, I'ld like to be able to catch the fact that the component is "faulted", and unload it (with of course, a nice message at screen to tell the user his component is not working properly).

I was looking in MEF programming guide but couldn't found the best way to managed that. Is there a right way to Isolate Parts in order not to crash my application in a component unhandledException case?

Thanks for your ideas,

Pierre L.

Mar 9, 2010 at 5:44 PM

Hi Pierre

We don't currently do anything in MEF wrt to isolation. However there are existing isolation options in the framework which it is possbile to combine with MEF. Some folks have looked to using System.Addin for their isolation needs while others use remoting directly. MEF doesn't stop you from using either. Kent Boogaart has a post on one way to do this with System.Addin which you can find here:



Mar 10, 2010 at 10:21 AM

Hi gblock,

again, thank you for answering all my posts ;)

I might just give another shot to MAF, just in case I could found a way to simplify my addin scenario.



Pierre L.