I cannot for the life of me figure out how to put a fully trusted excel doc out on a shared drive on our network. I have done everything I can think of. I have combed this forum and have literally tried everything that has been posted about an .xls doc and full trust and I continue to get the error below.
I can open the .xls from the share when logged onto my pc, but when I log onto another pc I get the error below. The other pc has the VSTO runtime and the .NET 2.0 framework.
If I can ever figure this out I would like to give my doc full trust via code, if possible. Can you go to the code-behind file and apply trust persmissions If so, how
I am using VSTO 2005. And Office 2003.
The customization does not have the required permissions to execute.
************** Exception Text **************
System.Security.SecurityException: The customization does not have the required permissions to execute.
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.HandleOnlineOffline(Exception e, String basePath, String filePath)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.CreateCustomizationDomainInternal(Uri uriFullDocumentDirectory, Uri uriFullDocFilePath, String documentName, IHostServiceProvider hostCallback, IAddinSecurityManager secman, AppManifest& applicationManifest, Boolean& manifestDirty, IAppInfo& appInfo)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.CreateCustomizationDomain(String applicationDomainPath, String documentName, IHostServiceProvider hostCallback, IExecuteCustomization& executor)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManager.CreateCustomizationDomain(String applicationDomainPath, String documentName, IHostServiceProvider hostCallback, IExecuteCustomization& executor)
The Zone of the assembly that failed was:
MyComputer
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Applications.Runtime
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.Office.Tools.Common
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/8.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

Publishing Excel doc on shared drive
Chin Tian
BANG18
Hi, have you configured the Framework's Security Policies on the other PC
The error you get suggests that either you haven't created the appropiate security policy (by means of using caspol.exe) or that the policy created is not working on the right level (enterprise, machine, user).
The easiest way to configure this policy is by having your dev machine create an installer that you can run on the remote machine. Just go to the "Microsoft .NET Framework 2.0 Configuration" console (should be found under the Administrative Tools Menu), navigate to My Computer / Runtime Security Policy, and look for the security policy that is making your Application Work locally (in my case it's located in Machine / Code Groups / All_Code / LocalIntranet_Zone / *).
Then you can simply right click the Runtime Security Policy, and use the "Create Deployment Package" Wizard by choosing the right level (Machine in my example) and then running the resultant MSI file on the other PC (it runs silently, so it's hard to tell if the installation was succesful or not, but you can try and run the application to see if it worked).
Hope this helps!
Douglas Chor
This is my experiance, with an Excel VSTO excel file on a client box and the assemblies on a remote computer.
- Client needed to be updated to 2003 SP1 of office.
- Client needed the download update from office update on the web which targetted VSTO on open issues on remote machines.
- Had to install Office 2003 Interops and VSTO runtime from the VSTO developers install and not individually from individual sources...why I don't know...
- Had to create a program to write to the excel files manifest to inform the document that it would be dealing with a remote assembly. See example here
- Had to use Caspol (in the .net 2.0 directory of windows) to inform the security issues of .Net that remote assemblies at the remote location could be fully trusted.
For steps 4/5 you can see excellent documentation on "Visual Studio 2005 ... Quick Start #3: Deploying a Document to a Local Folder, and an Assembly to a Network Folder"Good luck.
Mike Fang
Hi,
Normally, for a network deployment like the one you mention, you can use the Machine Level at the LocalIntranet_Zone with a Condition of URL type.
It also looks like you have to apply a Policy for the document itself (*.doc) since it's going to be opened from an external folder.
Please check out the guide in the VSTO2 Blog for an example on how to do this (see the Setting Security Policy part at the end).
Once you have this running fine on your machine you can use the method I commented on my last post to create the MSI installer, so you can easily deploy to the 150 client machines.
Please tell us if it works!
senordotnet
Howard Lung
Hi, I'm glad that the MSI idea worked fine.
I don't have much experience with installers, but I think that the MSI that installs the policies can't be modified. I have to admit that I'm not really sure about this.
Nevertheless, you should be able to create your own Setup Project using Visual Studio, so that it installs the .NET Framework, VSTO Runtime, PIAS and any other MSI you want (like the policies one) as personalized prerequisites for your solution.
I found this nice article explaining how to do it:
http://msdn.microsoft.com/library/default.asp url=/library/en-us/odc_vsto2005_ta/html/OfficeVSTOWindowsInstallerWalkthrough.asp
Just look for the paragraph called: Using Windows Installer to Deploy a Visual Studio 2005 Tools for Office Solution.
I'm sorry if I'm not of much help on this subject, but hopefully the article may give you a headstart on what you want to do.