2
votes

I am struggling with creating a Word 2010 addin and creating a windows installer package to deploy the addin. The target framework for the addin is .NET 3.5.

From what I understand when reading the deployment guide from Microsoft, VSTO runtime for .NET 3.5 is installed with Office 2010.
Does this mean I can assume that as long as Word 2010 is installed on the target computer, the VSTO runtime for .NET 3.5 will be present as well?
http://msdn.microsoft.com/en-us/library/ff937654.aspx

Another problem I am having concerns which version of the vsto I should reference.
The deployment example code available via the link above references an assembly which I assume (version is 9, not 4 that I was expecting) is part of the VSTO 2010 targeted for .NET 3.5
Program Files\Reference Assemblies\Microsoft\VSTO\v9.0\ Microsoft.Office.Tools.v9.0.dll

But when I check the launch conditions for the installer in the example, it searches for VSTO 2010 Runtime by checking for the version string in the key
HKLM\Software\Microsoft\VSTO Runtime Setup\V4R
or
HKLM\Software\Microsoft\VSTO Runtime Setup\V4

However the assemblies referenced had v9.0 in the folder path which makes me think they would match
HKLM\Software\Microsoft\VSTO Runtime Setup\V9.0.21022 or V9.0.30729

Can I still use v4 even though when I reference the assembly I use v9, or am I mixing things up here?

1

1 Answers

5
votes

You want to use the click-once deployment method for add-ins. Go to the publish tab on the project's properties and click pre-requisites. Here you can add the 2010 VSTO framework. When your project builds, it will build a setup.exe that will need to be run by your users. This will guarantee that the necessary bits are installed plus launch the vsto install.

The versions are all very confusing. Version 9 is VSTO 3 for Visual Studio 9 which supports Office 2007. You want VSTO 4 (installed for Visual Studio 10) for Office 2010. Make sure all your references are referencing the correct versions. This version is also backwards compatable so it will work with 2007 so long as you don't use any features that aren't available to 2007.