0

I am using MAF for my Addin development. All seems to be working fine, but one issue needs be sorted...

I activate the plugin in their own process, i,e, using

var process = new AddInProcess(); myAddinToken.Activate(process,AddInSecurityLevel.FullTrust);

When an unhandled exception occurs in the add-in, my host crashes! Since i am running the addin in a seperate process, why i am i still seeing my host app crash because of an unhandled exception in the ad-in?

Is it not supposed to simply crash the add-in specific dedicated process, and leave the host process as-is live?

Any ideas how to fix this?

4

1 回答 1

0

使您的应用程序崩溃的异常是什么?

您是否有来自 AddIn 的 UI 元素?

使用 UI,我必须正确关闭/处理主机端的 UI 元素并捕获 RemotingException

也许这对您有所帮助:

AddInToken grailAddInToken = addInTokens[0];
AddInProcess addInProcess = new AddInProcess();
addInProcess.Start();
Process process = Process.GetProcessById(addInProcess.ProcessId);
process.EnableRaisingEvents = true;
process.Exited += (s, e) => synchronizationService.Invoke(() =>
{
     window.Close();
});    
于 2013-06-24T11:34:18.423 回答