ps0118mj

I have a VSTO solution developed using VSTO and VS2K5. I've followed all the steps in previous articles regarding this kind of deployment (prerequisites, CAS, etc.) and it's been successful up to a point. I've integrated the SetSecurity project in order to give my assembly Full Trust, but I have another assembly which is in my solution, and it is called from the primary assembly. When assemblyA (given full trust via SetSecurity project) tries to instantiate something from AssemblyB, I get the "Could not load file or assembly.....Failed to grant permission to execute"

How can I also grant AssemblyB Full Trust and avoid this error Thanks for any help you can provide.



Re: Visual Studio Tools for Office "Failed to grant permission to execute" error calling 2nd assembly, Outlook add-in (installs fine and runs up to error)

Jeff Young - MSFT

Part 1 of the Whitepaper makes a comment about this in the "Granting Trust to the Customization Assembly" section. (http://msdn2.microsoft.com/en-us/library/aa537173(office.11).aspx) That is, "If your solution has other referenced or satellite DLLs, you must create an additional assembly code group with the appropriate level of permissions.".





Re: Visual Studio Tools for Office "Failed to grant permission to execute" error calling 2nd assembly, Outlook add-in (installs fine and runs up to error)

Syed Raza

You can try by giving FullTrust to the solutionInstallationUrl in SetSecurity project like I did as:

string arguments = policyLevel + " -q -ag " + parentCodeGroup + " -url \"" + solutionInstallationUrl + "\" FullTrust -n \"" + solutionCodeGroupName + "\" -d \"" + solutionCodeGroupDescription + "\"";

-FR