2

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?

Community
  • 1
  • 1
user265445
  • 341
  • 1
  • 4
  • 11
  • 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 Feb 19 '10 at 06:11
  • 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 Feb 22 '10 at 21:34
  • @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 Dec 22 '10 at 10:58

2 Answers2

1

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.

Todd Main
  • 28,951
  • 11
  • 82
  • 146
  • In order to target to a version I think you need that version installed (eg: to target 2007 you need 2007 installed). If I can't have both Office versions installed on the same development computer how can I target both versions? – user265445 Feb 03 '10 at 17:32
  • Yeah, this can get confusing. You'll need VSTO 2005 SE to multi-target, but only at least one of those products installed on your box from Office 2003 or Office 2007. See requirements on http://www.microsoft.com/downloads/details.aspx?FamilyId=8315654B-A5AE-4108-B7FC-186402563F2B&displaylang=en – Todd Main Feb 03 '10 at 18:20
  • Isn't VSTO 2005 SE only for VS 2005? Your link was for the runtime version for a user computer not for the developer. VS 2008 comes with VTSO 3.0. – user265445 Feb 03 '10 at 18:35
  • 1
    Sorry about the confusion. Yes, to install VSTO 2005 SE you'll need VS 2005. For VS 2008, what comes with it is VSTO 3.0, but the runtime is VSTO 2005 SE when you are targetting 2003 solutions. So you can use VS 2008 to develop for both, but the interops/VSTO runtimes/.NET runtimes required will be different for each solution. – Todd Main Feb 03 '10 at 19:47
  • I am still a little confused. So can I have VS2008, Office 2003, and Office 2005 installed on my development machine and can I then target an add-in to either version of office? Or do I need to also install have VS2005 and/or VSTO 2005 SE installed to target Office 2003? – user265445 Feb 04 '10 at 15:28
  • I assume you meant "Office 2007" when you wrote "Office 2005". If so, you should not have *both* Office 2003 and Office 2007 on your box - just one of them. With VS2008, you will be able to target either 2003 or 2007 (but for the Offce suite that is *not* installed on your dev machine, you'll need to test that solution on a different computer). VS2008 uses two seperate technologies for your targets (VSTO2005SE for 2003 solutions and VSTO3 for 2007 solutions). You can also check out this: http://stackoverflow.com/questions/2063866/beginning-vsto-development/2064899#2064899 – Todd Main Feb 04 '10 at 17:34
  • I currently have VS2008 and Office 2007 installed on my development machine. I am able to create a project targeted to Office 2007. When I create a project targeted to Office 2003 I immediately receive the error "This project requires Microsoft Office Excel 2003 and the registered primary interop assemblies, but these are not installed." So it looks like it is telling me I need to install Office 2003 (but I thought I shouldn't have both versions of Office on the development machine)? – user265445 Feb 04 '10 at 20:09
  • Are you trying to create an Excel 2003 Add-in, Excel 2003 Workbook or Excel 2003 Template. In your environment, you should be able to create an Excel 2003 Add-in without issue. Try going to your Control Panel and in the Install Programs section, find "Visual Studio 2005 Tools for Office Second Edition" and click "Unstall/Change", then choose "Repair". Excel 2003 Templates and Workbooks are not supported for development in this environment unless you have Excel 2003 (or Office 2003) installed - in which case you shouldn't have Office 2007 installed. – Todd Main Feb 04 '10 at 21:09
  • I am trying to build an Excel 2003 Add-In. btw: On additional bit of info-I had VS2005 already installed on this machine. So I have VS2005, VS2008, and Office 2007. – user265445 Feb 04 '10 at 22:00
  • Hmm..I haven't seen that configuration before. Have you tried the "repair" on VSTO 2005SE yet? One of the reasons to do that is that the default settings of VS2008 install don't appear to install everything you need (unless, of course, you choose to install everything)l. – Todd Main Feb 05 '10 at 01:07
0

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.

ericphan
  • 267
  • 2
  • 10