Documents with customisation attached to emails fail to open with customisation. -
08-29-2007
, 10:58 AM
Hi,
when sending a document with VSTO customisation via email the
recipient recieves the document but they cannot open it directly from
the outlook email by double clicking. The document opens but the
customisation fails and they get the following error message:
System.IO.FileLoadException: Could not load file or assembly
'xxxxxxxxxxxxx, Version=1.6.0.4, Culture=neutral,
PublicKeyToken=xxxxxxxxxxxxxx or one of its dependencies. Failed to
grant permission to execute. (Exception from HRESULT: 0x80131418)
File name: 'xxxxxxxxxxxxxxx, Version=1.6.0.4, Culture=neutral,
PublicKeyToken=xxxxxxxxxxxxxxxxx' --->
System.Security.Policy.PolicyException: Execution permission cannot be
acquired.
at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Int32& securitySpecialFlags, Boolean
checkExecutionPermission)
at
Microsoft.VisualStudio.Tools.Applications.Runtime. AppDomainManagerInternal.HandleOnlineOffline(Excep tion
e, String basePath, String filePath)
at
Microsoft.VisualStudio.Tools.Applications.Runtime. AppDomainManagerInternal.LoadStartupAssembly(Entry Point
entryPoint, Dependency dependency, Dictionary`2 assembliesHash)
at
Microsoft.VisualStudio.Tools.Applications.Runtime. AppDomainManagerInternal.ConfigureAppDomain()
at
Microsoft.VisualStudio.Tools.Applications.Runtime. AppDomainManagerInternal.LoadAssembliesAndConfigur eAppDomain(IHostServiceProvider
serviceProvider)
at
Microsoft.VisualStudio.Tools.Applications.Runtime. AppDomainManagerInternal.ExecuteCustomization(IHos tServiceProvider
serviceProvider)
If the file is saved to the desktop it works fine.
I have also found that if the following CASPOL lines are executed the
documents launch sucessfully, however, exposing the Internet Zone from
outlook isn't something I want to do. Note that Intranet zone doesn't
work either.
CASPOL -quiet -m -ag Internet_Zone -url "c:\Documents and Settings\*"
CASPOL -quiet -m -ag "App X User Documents" -custom "%ProgramFiles%
\Microsoft Office\Office11\Addins\Msosec.xml" FullTrust -n "AppX
Internet Data Documents" -d "Grants FullTrust to all documents"
Is there any other way to do this?
thanks for any advice,
Sharat Koya |