I have a windows service that uses MAF to load user created plugins. Here is how I am 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 the addins will load ok without any issues. The problem I am having is that I don't have control over the quality of the addins and sometimes they crash and cause the whole service to stop. Is there a way for me to properly catch any errors that come out of the addins so it won't crash the service.