The main design considerations of Office Application-Level Add-In Architecture are following:
- Each add-in is loaded in new application domain so as to isolate it from main app and other add-ins. Thus if the add-in hangs whole app doesn’t crashes.
- Security and Permission level checks performed on add-ins.
- Clean shutdown of application and loaded add-ins.
The main components which take part in functioning of Application-Level Add-Ins are following:
The component is named VSTOEE.dll and is responsible for loading the correct version of VSTO runtime when a document-level customization is opened or add-in is started.
It is named VSTOLoader.dll. This is responsible forloading the VSTO application. It also creates a new Application Domain for eachadd-in and performs security checks on VSTO application.
This is where the Office application discovers the add-ins installed and to be loaded.
Applications in the 2007 Microsoft Office system look for the Manifest entry under the key HKEY_CURRENT_USER\Software\Microsoft\Office\application name\Addins\add-in ID(or, for Visio, HKEY_CURRENT_USER\Software\Microsoft\Visio\Addins\add-in ID).
The Manifest entry specifies the full path of the deployment manifest.
Deployment Manifest and Application Manifest
The list of Deployment manifest indicates the add-ins installed. Each deployment manifest points to the correct version of an application manifest which in turn points to assembly paths and entry points.
Add-In Loading Process
- The Office Client application checks the registry installed add-ins.
- It loads Runtime Loader which in turn loads Solution Loader.
- SolutionLoader loads the .NET Runtime and managed portion of VSTO Runtime.
- Latest versions of Deployment and Application manifests are downloaded. Once security checks are passed, latest add-in assemblies are downloaded.
- New application domains are created for each add-in and add-ins are loaded into that app domain.
- Various entry point methods of Add-in are called before finally calling ThisAddIn_Startup method which is default event handler for Startup event.
(Text quoted from http://bit.ly/cGul3q)