views:

109

answers:

1

I have an VSTO (outlook-addin) application that uses Unity. It is deployed to a folder inside Programs Files and full trust is set on that folder to allow all code FullTrust that runs from there.

What I am getting now is a strange error that I cannot get to the bottom of.

System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for myUnityConfigSection: That assembly does not allow partially trusted callers. (c:\work\CoreDev\src\Perito\Case\Client\Windows\Integration\Outlook2003\bin\Debug\Perito.Case.Client.Integration.Outlook2003.dll.config line 528) ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.

One of the files in the unity config seems not to allow partially trusted code yet the error isn't descriptive enough to tell me what is going on. I cannot debug the VSTO solution to find out what is going on.

Any help with this would be great.

+1  A: 

Add this line to the assemblyinfo.cs file of the addin project:

[assembly: System.Security.AllowPartiallyTrustedCallers]

I've been using Unity with my VSTO project as well, and it's been a great experience overall.

code4life