BenDowling

I have created a VSTO 2005SE add-in for Outlook 2003. I've followed the step desribed in http://msdn2.microsoft.com/en-us/library/bb332052.aspx, and it builds, deploys, and runs without any problems.

However, on a couple of machines I've been running it on I get a security error, and the add-in doesn't load. After applying the VSTO_SUPPRESSDISPLAYALERTS variable I get the error below. As I mentioned, the security settings seem to be fine after the add-in is installed, and it runs find in Outlook a number of times.

Any help will be greatly appreciated!

Ben
_________________________________________________

Could not load file or assembly 'OutlookAddin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e96302ca6304d2ed' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)

************** Exception Text **************

System.IO.FileLoadException: Could not load file or assembly 'OutlookAddin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e96302ca6304d2ed' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)

File name: 'OutlookAddin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e96302ca6304d2ed' ---> System.Security.Policy.PolicyException: Execution permission cannot be acquired.

at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)

at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)

....





Re: Visual Studio Tools for Office Outlook Addin Security Problems

X4U

Hello Ben,

see if this Fix can help you with your Issue.

http://support.microsoft.com/kb/937652/en-us

Greets, Helmut






Re: Visual Studio Tools for Office Outlook Addin Security Problems

Mike Walker

The Patch may help but the actual error is the Loader was unable to Grant Execute permissions. This means the Security Policy hasnt been deployed to the Client.

Under Control Panel -> Administrative Tools -> .NET 2 Configuration and then check the policy for your addin exists under the relevant security area Local Machine/User etc etc

The error is very clearly a permission problem.

Regards






Re: Visual Studio Tools for Office Outlook Addin Security Problems

BenDowling

The problems I've seen have been on Windows XP.

The security policy was deployed to the client because the add-in ran without any problems for several days before this error occurred. I've seen it on a couple of machines, while on others the add-in continues to run without any issues.

I'm don't have access to any of the machines experiencing problems at the moment, but I'll check tomorrow and let you know if the policy still exists. If it doesn't how could it have been removed, because it clearly was installed at one point

[UPDATE: I've looked on the machine I can't see a .NET option under administrative tools]

Many thanks, Ben






Re: Visual Studio Tools for Office Outlook Addin Security Problems

BenDowling

Is anybody able to offer any further help on this I'm really stuck!

Thanks in advance, Ben




Re: Visual Studio Tools for Office Outlook Addin Security Problems

X4U

Hello Ben,

I can remember there was an issue with a security patch that maybe resets the Caspol Settings for VSTO AddINs.

See this: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1906089&SiteID=1

Hope this helps,

greets Helmut






Re: Visual Studio Tools for Office Outlook Addin Security Problems

BenDowling

Thanks Helmut, that was exactly the problem!