AddInProcess and WCF

Apr 12, 2010 at 9:35 PM

I recently created a WPF Host to manage addins using System.AddIn which works great. I have decided to move the add-in management portion into a WCF service and keep the WPF frontend. Currently I create a separate AddInProcess for each AddIn that I activate:

AddInProcess proc  = new AddInProcess();

AddInView theView;

theView = token.Activate<AddInView>(proc, AddInSecurityLevel.FullTrust);

If I run this in a WPF environment everything is fine in WCF I am getting an exception on the Activate call:

+  $exception {"Unable to cast transparent proxy to type 'OpenScan.Corporate.Adapter.Contracts.IAddInContract'."} System.Exception {System.InvalidCastException}

When I change the Activate call to use the same Domain it works

<font size="2">

theView = token.Activate<

</font>

AddInView>(AppDomain.CurrentDomain);

The problem is that is is critical I run all AddIn's in a separate isolated process. Is this possible under WCF using an AddIn pipeline?

Thanks.