Assemblies in Office Projects Overview
The code that you write in Visual Studio Tools for Office projects is eventually compiled into an assembly. Assemblies in Visual Studio Tools for Office solutions are usually deployed to a shared server or to a directory on the client computer.
Visual Studio Tools for Office solutions use an application manifest to identify the assembly. The application manifest contains information about the assembly's name, version, and location, so that the application can find, link to, and run the correct assembly.
For more information about assemblies, see.
Assemblies in Document-Level Projects
Document-level projects include a document as well as an assembly. The document acts as the front end of the application and is where all user interaction takes place. Each document can have only one main project assembly associated with it; however, multiple documents can point to the same assembly.
Assemblies in document-level projects are not actually part of the document; instead, they are stored elsewhere and are identified by the document's application manifest.
For more information about application manifests, see.
The assembly can reference other assemblies, which are listed in the project's references. However, one document-level project assembly cannot reference another document-level project assembly .
If your solution depends on the Internet Explorer cache to provide offline capability, you must explicitly load all referenced assemblies or they might not be available to the application while offline. Assemblies are not loaded into the Internet Explorer cache until they are used. If the solution did not call a referenced assembly while online, that referenced assembly is not available offline. To ensure that all assemblies are loaded into the cache when the solution is opened online, call
Startup event handler.
Security Considerations for Assemblies
For a Visual Studio Tools for Office solution to run on a computer, the assemblies used by the solution must have full trust permissions. Therefore, at deployment time, you must ensure that the appropriate full trust permissions are granted. These permissions are based on evidence. The evidence can be location based or assembly based (by digitally signing the assemblies). For more information on security, see.
By default, the assembly is granted full trust when you build the project, using the URL as evidence. To change this, you can set the Trust Assemblies Location property of the project to false. Setting this property to false means that you must grant full trust to the assembly some other way, or the project will not run.
For security reasons, it is best to create projects on your local computer, rather than developing on a shared location. For more information, see.
Security for Referenced Assemblies
Referenced assemblies that are in your project's output folder also receive full trust permissions when the project is built. Most assemblies that are installed in the global assembly cache (GAC) have full trust, but some do not. If you have problems running your solution, check that referenced assemblies in the GAC have full trust.