Trusted location error in VSTO clickonce on network drive

Michael Andy Poulsen 0 Reputation points


We are publishing vsto-projects via clickonce and have started facing a problem when we references them as described here:

We add the properties _AssemblyLocation (pointing to a http-path) and _AssemblyName.

This works when the file is saved locally, but not on a network location (used to work). Currently the majority of the files are saved on network drives to be access by employees in different departments.

Adding the network drive as a trusted location is not allowed by our security department, and without this we get this error:


Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: This document contains custom code that cannot be loaded because the location is not in your trusted locations list: test.xlsx. If you trust this document you can save and open it from a location on your computer. For more information, see

at Microsoft.VisualStudio.Tools.Office.Runtime.RuntimeUtilities.VerifyDocumentIsTrusted(String documentFullLocation, String documentName, OfficeVersion officeVersion)

at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.GetAssemblyDataFromManifests(String solutionLocation, String manifestLocator, String documentName, Boolean showUIDuringDeployment, CustomizationType customizationType, OfficeVersion officeVersion, IHostServiceProvider interopServiceProvider)

at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, Boolean useFastPath, IntPtr& executor)


It has been working for many years, but at some point some restrictions seems to have been added to Excel.

Given the limitations with regards to the trusted locations are there any way around this problem given that the files should be kept in the network location?


Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,583 questions
0 comments No comments
{count} votes