Deployment

VSTO does not support any kind of digital signature verification.
VSTO solution always just has a single assembly.
The VSTO runtime requires any assemblies to have full trust permissions to execute.


VSTO supports both local installs and network installs
Visual Studio Installer vs InstallShild LE (in Visual Studio 2010)



Local/Local

Office file and assembly are installed locally
Customisation assembly must be in the same directory as the office file
This directory must be fully trusted
Application manifest is embedded into the solution
No deployment manifest


In this model both the office file and the assembly are installed locally on the user's machine. This model is similar to installing using an MSI file.
Advantages are that the application can be used when offline and it can also be uninstalled or repaired from Add/Remove Programs.
Disadvantages are that the application is very difficult to update and any update must update all machines


Local/Remote

Has a deployment manifest on the server
Security policy must either trust the server (or network location) or the assembly strong name (or both)


This is the most common. A copy of the office file is on the local machine but the assembly is on the server.
This model allows the user to make changes to the document and still be linked to the latest assembly on the server. The latest version of the assembly is automatically picked up the next time the office file is opened


Remote/Remote

Both the office file and the assembly are located on the server.
This is usually implemented with a template (.xlt or .dot). Using a template allows each user to create a new instance of the office file from a centrally located template.
After the user has created the template the user often saves a local copy,. Using SharePoint to then store these office files is a pure remote/remote model.
With this model you must explicitly trust the office file as well as the assembly.






If you run the code again while connected, VSTO checks to make sure that you have the latest version downloaded.
When you are not connected VSTO runs the cached code.


Cab Project

Much like a zip file, this compresses a number of small files into an easy-to-use (and easy to transport) package.
This option can be combined with the others.
You could create a CAB file if you have lots of small graphic files that you had to distribute with your application.



Screen shots of the View > submenu
Screen shots of the Add > submenu



Setup Wizard

This helps you create one of the many setup types



On Installation make it clear what changes/options are effective immediately and which take effect the next time you star/reopen the application.




Cleaning Before Installing

When you build your project there are some custom build tasks that are part of the project file that deploys your add-in on your development machine.
This can make it difficult to test your Setup Project because building the solution automatically installs the add-in.
One workaround it that after you build your solution you can uninstall the add-in by right clicking on the add-in project and clicking Clean. Running Clean will uninstall the add-in.



When building/running on the same PC
If you have it installed you must clean the solution before rebuilding and reinstalling


Can't install both Office 2003 and Office 2007 with Visual Studio 2008 and Visual Studio 2005
Well you can but there are just lots of problems:
1) Workbook designer does not display properly.




When your application is finished you will want to deploy it
Visual Studio applications rely on the .NET framework class libraries
Visual Studio application are compiled as "assemblies" deplymeny units consisting of one or more files necessary for the program to run.


Assemblies contain four elements:
     ● Microsoft Intermediate Language Code (MSIL) code - Your program code compiled into a language that the CLR can understand.
     ● Metadata - information about the types, methods and other elements defined and referenced in your code.
     ● Manifest - name and version information, security and other information about the assembly
     ● Supporting files and resources



Because the assemblies are co comprehensive and self-describing they do not need to be formally registered with the operating system inorder to run.
Therefore an application can be installed by simply copying the assmebly onto the computer (assuming it has the .NET framework installed).


To manage the deployment process you need to add a deployment project to your solution.



Copy Program Files to Local Profile

Copy all the important files from the program files directory to their local profile



Captivate - Adobe Video Recording ??



Deployment Project

Run the Setup Wizard to create the installation files.


link - blogs.msdn.com/acoat/archive/2008/07/27/vsto-v3-deployment-session.aspx


ClickOnce

This is a deployment technique that allows for a self-updating Windows based application that can be installed and then run with minimal user interaction
This method of deployment supports offline, automatic updating and rollback
Unlike the Setup / Windows Installer technique nothing is added to the Program Files directory, the registry or to the desktop
Deploying using ClickOnce only supports creating keys under HKEY_CURRENT_USER
link - https://robindotnet.wordpress.com/2010/05/31/enhanced-logging-in-clickonce-deployment/


ClickOnce Facts

ClickOnce does not support writing keys to the registry.
Cannot be used to install and add-in in HKEY_LOCAL_MACHINE
ClickOnce is not capable of deploying additional components such as registry keys.
ClickOnce does not support having the same add-in installed from 2 different locations.
ClickOnce supports digital signing security features.
ClickOnce security relies on a code-signing certificate. You can use the certificate generated by Visual Studio which will give the user a pop-up asking if they trust the source
ClickOnce deployment will grant full trust to Office solutions automatically ??


In Visual Studio 2008 a user can press the Cancel button which disables the add-in
This was fixed in Visual Studio 2008 SP1 so pressing cancel just leaves the old version working


You can make a Visual Studio 2008 add-in for Office 2003 available to all users by creating the registry entries under HKLM instead of HKCU.



Project Properties, Signing Tab

SS
The test certificate is configured to automatically sign the deployment manifest every time you publish


SIgn the ClickOnce Manifest -
Select from store - Allows you to change the certificate if you want to use a different one
Create test certificate - The test certificate that is created for you automatically expires one year after it has been created. If the test certificate has expired the project will not build.
More Details - Displays the "certifcate" dialog box to show you additional information
Timestamp server URL -
Sign the assembly -
Choose a strong name key file -
Change password -
Delay sign only -


Deployment Strategies

There are three different strategies you can choose from
1) Install from a website or network share
2) Installl from a cd
3) Start the application from a website or network share


Strategy 1
Application is deployed to a web server or network share
To install click on an icon on the web page
Application is downloaded, installed and started
Application appears in the Add/Remove Programs dialog box
In the Publish Wizard, click From the Web
This is the default deployment strategy


Strategy 2
Application is saved on a cd
To install click on the file
Application is installed and started
Application appears in the Add/Remove Programs dialog box
In the Publish Wizard, click From a CD-Rom


Strategy 3
To install click on an icon on the web page
Application is started
When the application is closed the application disappears and is no longer available
Nothing is added the Add/Remove Programs dialog box
The application is actually downloaded and installed into the ClickOnce Cache
In the Publish Wizard, click Do not install the Application on the "Install or Run from Web page"



Allows you to publish, update and cache the code locally.


Supports publishing to:
     ● local drives
     ● UNC paths
     ● http sites
     ● removable media (cds, dvds, usb drives)


All ClickOnce deployments must be signed with a digital certificate
By default ClickOnce applications are automatically signed with a Self-Cert and are excluded from Trusted Application Deployment.
When you sign a ClickOnce deployment using a certificate, ClickOnce records the date and time of the signing and embeds it into the deployment's digital signature.
As long as the deployment was signed when the certificate was valid, ClickOnce will allow the application to run even if the certificate has since expired.



The IE settings to affect how ClickOnce works if the installer is on a website because the .NET framework uses IE settings to determine if that particular website can be trusted.
Installation folder URL - customers want to deploy the solution locally on their servers.


This is a deployment technique that allows for a self-updating Windows based application that can be installed and then run with minimal user interaction
This method of deployment supports offline, automatic updating and rollback
Unlike the Setup / Windows Installer technique nothing is added to the Program Files directory, the registry or to the desktop
Deploying using ClickOnce only supports creating keys under HKEY_CURRENT_USER
link - https://robindotnet.wordpress.com/2010/05/31/enhanced-logging-in-clickonce-deployment/


How to Deploy VSTO solutions ?

There are several ways of installing your VSTO solutions
1) Run the setup.exe


2) Opening the vsto deployment manifest
(assuming that the VSTO runtime is already installed)


3) Opening the customised workbook or document (document-level only)
(assuming all pre-requisites are already installed and security policy has been set)


4) Opening the host application (application-level only)



Loading a new Version Sequence

Loading the correct version involves several steps
1) The VSTO runtime reads the application manifest embedded in the solution and gets the location of the deployment manifest
2) The VSTO runtime compares the version of the application manifest with the version in the deployment manifest
3) If the versions do not match then the corresponding application manifest is downloaded. This replaces the existing application manifest in the document.
4) The VSTO then reads the location of the assembly and loads it.


Manifests

These are necessary if you are deploying your solutions using the Publish Wizard.
Using application and deployment manifests enable automatic updating and rollback
This deployment architecture is based on two XML files: an application manifest and a deployment manifest:


.vsto (Deployment manifest - VSTO)

This identifies the current version and other deployment settings
The deployment manifests in Visual Studio 2008 have a .vsto file extension
This is the same format as that used for ClickOnce.


.manifest (Application manifest)

Describes all the assemblies that make up the application.
Describes the application including assemblies, dependencies, permissions etc.
Contains information about where the assembly is located and which host item classes need to be created.
There can be several application manifests, one for each version of the customisation.
These are embedded in the Excel and Word VSTO solutions and point to where the assembly is located.
It also points to the corresponding deployment manifest


.deploy (Deployment manifest)

This is only used when you are deploying using ClickOnce.
A .deploy extension is generally added to the end of the deployment and application manifests although this is not mandatory.


.application

This file was only used by Visual Studio 2005 SE
This is to point the VSTO runtime to the most recent version of the application manifest.
There can only ever be one deployment manifest
Normally deployed to a shared folder or web server.
Automatically generated by the Publishing process


This points to the current version of the application manifest
This file is misidentified by Windows Explorer as an application manifest
SS


Utilities > MAGE.exe


Editing Manifest Files

To edit VSTO application manifests you have a couple of options:
1 Use the VSTO Application Manifest Editor
This is an editor that ships with the VSTO SDK


2 Use the ServerDocument object model
This can be used to write a program that can be used to manipulate both the application and deployment manifests. Primarily designed to manipulate the cached data island on the server ?


Reference to the System.Deployment is needed if you want to display Publish version information.
.IsNetworkDeployed property
.CurrentVersion property


Application Cache

Also known as ClickOnce Cache
Also known as the ClickOnce Application Cache or ClickOnce Deployment Cache https://msdn.microsoft.com/en-us/library/267k390a.aspx


All clickonce applications which are installed locally or hosted online are saved on the clients computer in a ClickOnce Application Cache The ClickOnce Cache is a group of hidden folders under the users profile, Local Settings folder.
This folder holds all the application files, assemblies, configuration files, application and user settings.
The folder/cache helps to isolate applications as well as separating different versions of the same applications.


If an application is set to run online then every version that the user has accessed is kept If an application is set to run locally then only the current version and the previously installed one is kept.


Where is the ClickOnce Cache ?


Windows 7 - C:\Users\"username"\AppData\Local\Apps\2.0\
Windows XP - C:\Documents and Settings\"username"\Local Settings\Apps\2.0\


How to clear the ClickOnce Cache ?


There are two ways to clear the (entire) ClickOnce Application Cache mage -cc or
rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache


Cache Storage Quota

A clickonce application that is hosted online has a restriction on the amount of space that it can occupy in the ClickOnce Application Cache A clickonce application that is installed locally are not restricted in size and do not take up any space in the ClickOnce Cache folder A single partially-trusted online application cannot take up more than half of the Cache quota.


By default this size is restricted to 250 MB A system administrator could change this by changing the following DWORD key HKCU \ Software \ Classes \ Software \ Microsoft \ Windows \ CurrentVersion \ Deployment \ OnlineAppQuotaInKb \



Checking at Run time


System.Reflection.Assembly.GetExecutingAssembly().CodeBase


You can access these files using the System.Deployment namespace to determine their runtime location System.Deployment.ApplicationDeployment class


Deployment - Digital Signatures (add the deployment.h)


Adding the digital certificate to trusted publisher's list
Right click on "*.dll" in the installation directory.
Select Properties->Digital Signature tab
Select the Thomson financial certification from the list and click Details button.
The Digital Signature Details window is displayed.
In the General tab click 'View Certificate' button.
The Certificate window is displayed.
In the General tab- click the Install Certificate.
The Certificate Import wizard is displayed
Click the Next button
Select "Place all certificates in the following store" option and click on the Browse button.
Select the "Trusted Publishers" folder from the list.
Click OK
Click Next
Click Finish.


Important

In Visual Studio 2005 the Application Manifest had the following file extension .manifest


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext