c# - How do I properly handle a MAF addin crashing within a windows service host? -


i have windows service uses maf load user created plugins. here how loading each addin:

public bool activateplugin() {     try     {         _addin = _token.activate<iaddin>(addinsecuritylevel.host);         return true;     }     catch(exception ex)     {         addtolog("error activating plugin");         return false;     } } 

all addins load ok without issues. problem having don't have control on quality of addins , crash , cause whole service stop. there way me catch errors come out of addins won't crash service.

look @ these articles blog of system.addin team information on exception handling , add-ins:

http://blogs.msdn.com/b/clraddins/archive/2007/05/01/using-appdomain-isolation-to-detect-add-in-failures-jesse-kaplan.aspx

http://blogs.msdn.com/b/clraddins/archive/2007/05/03/more-on-logging-unhandledexeptions-from-managed-add-ins-jesse-kaplan.aspx

basically way safe activate add-in in separate process. easy because maf provides way can imagine expensive in terms of performance.

note activating add-in in different application domain not guarantee add-in not crash host. host crash in case of unhandled exception raised thread created add-in.

i know question bit old else find information useful.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -