2
votes

Does VSTO 3.0 (using Visual Studio 2008) support both Office 2003 and Office 2007 installed side-by-side on a single development computer so that both Office 2003 and Office 2007 can be targeted (in separate solutions)?

I have seen conflicting information about this.

NO: http://msdn.microsoft.com/en-us/library/bb398242.aspx

Visual Studio Tools for Office does not support installing Microsoft Office 2003 and the 2007 Microsoft Office system (or different versions of the same application, such as Word 2003 and Word 2007) side-by-side on the development computer. To develop solutions for different versions of Microsoft Office, use a different development computer for each version of Microsoft Office.

YES: http://msdn.microsoft.com/en-us/library/15s06t57.aspx

When you install Visual Studio Tools for Office, the primary interop assemblies are automatically installed to a location in the file system, outside of the global assembly cache. When you create a new project, Visual Studio Tools for Office automatically adds references to these copies of the primary interop assemblies to your project. Visual Studio Tools for Office uses these copies of the primary interop assemblies, instead of the assemblies in the global assembly cache, to resolve type references when you develop and build your project.

These copies of the primary interop assemblies help Visual Studio Tools for Office avoid several development issues that can occur when both the 2003 and the 2007 versions of the Office primary interop assemblies are registered in the global assembly cache.”

Has anyone done this and were there any problems?

2
I may be missing something here, but assuming you could have both versions of office on your machine, what would you expect to happen when you debug your project? Which version of the office app should start?Mathias
When I setup the app I target it to a specific version of Office using one of the built-in templates, so I would like it to be able to debug the one that it was built with. In theory it is using the local copies of the pia not the ones in the gac so it could work probably. My understanding is that having both versions causes problems but I haven't tried it myself.user265445
@Mathias, I think you have the issue the wrong way around. The question is, when you start Office2003/2007, will your vsto addin load in both circumstances? When you debug an Office application you start eg Excel and just attach to that process or setup your project to start an .exe (either office2003 or 2007, whichever you want to test it with)PandaWood

2 Answers

1
votes

You can target both 2003 and 2007 with the same computer - but you need two different programs for that in Visual Studio (e.g. MyCoolThingfor2003.sln and MyCoolThingfor2007.sln) as they have different interops. But you should not have both Office programs installed on that same computer.

0
votes

You can't install Office 2003 and 2007 side by side. The two links you posted talk about different things. The first link says no to installing the actual Office 200x application, whereas the second link refers to the PIA (which is just a wrapper). You can install any version of the PIAs on a computer side by side, but it doesn't mean it'll launch different versions of office.

If your goal is to develop a VSTO addin that supports both Office 2003 and Office 2007, then you'll need to develop on a system with VS2008 + Office 2003.