Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTO (Outlook Add-In) Setup Deployment (C#)

I am having some issues creating a setup file for my Outlook 2007 add-in.

The issue is that the Add-In needs to have a registry entry that references the manifest (http://msdn.microsoft.com/en-us/library/bb386106.aspx). The project builds a manifest file that appears in my bin\debug folder. However, in my setup project, if I go and add project output, the manifest is never listed as part of the output. Oddly enough, the Setup does create a registry entry that references my manifest in my bin\debug folder but this is not suitable since that folder is not available on the machines where I will be deployed to.

Thanks.

====================================

for those interested, some background issues.

  1. If I use project output in my setup, the VSTO add-in installs fine the first time. If I uninstall and reinstall using the same setup, it does not install properly. If I rebuild the setup, it installs fine again (in other words, it only installs the first time a setup is run).
  2. I corrected (1) but removing the project output from my setup project and instead adding the files manually (my dll + the manifest) and then updating the registry keys to point to the manifest added. This time, I can uninstall and reinstall as much as I want with the same setup. However, for some reason, the setup creates two registry entries, one that I have manually put in that refers to the manifest I included, and one that gets automatically referenced and points to the manifest in my bin\debug folder. I am unable to remove this second set of registry entries as they do not appear anywhere in my setup project. The issue with leaving them there is that the add-in executes every command twice (since it is registered twice).

odd, eh?

like image 317
i8abug Avatar asked Apr 28 '10 19:04

i8abug


People also ask

How do I deploy VSTO add-ins in Outlook?

On the File menu, point to New, and then click Project. In the templates pane, expand Visual C# or Visual Basic, and then expand Office/SharePoint. Under the expanded Office/SharePoint node, select the Office Add-ins node. In the list of project templates, choose an Outlook VSTO Add-in project.

Where are VSTO add-ins installed?

The required VSTO Add-in registry entries are located under the following registry keys where Root is HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE depending if the installation is for the current user or all users.

What is VSTO add-in?

Visual Studio Tools for Office (VSTO) is a set of development tools available in the form of a Visual Studio add-in (project templates) and a runtime that allows Microsoft Office 2003 and later versions of Office applications to host the . NET Framework Common Language Runtime (CLR) to expose their functionality via .

How do I publish a VSTO add-in?

Complete the following steps to package your add-in using Visual Studio 2019. From the Build tab, choose Publish [Name of your add-in]. In the Pick a publish target window, choose IIS, FTP, etc, and select Configure. Next, select Publish.


1 Answers

I found this Microsoft white-paper on VSTO for office 2007 add-in deployment very useful: http://msdn.microsoft.com/en-us/library/cc563937(office.12).aspx
(I initially linked to another paper which is also great, but applies to 2003 + 2007, which is somewhat different: http://msdn.microsoft.com/en-us/library/bb332052.aspx)
Specifically on the question of the manifest, I found out the hard way that when the registry key for the add-in had the same name as the add-in itself, for some mysterious reason during the build, the Manifest value was being silently replaced from the VSTO manifest to the add-in manifest.

like image 110
Mathias Avatar answered Oct 22 '22 12:10

Mathias