5

I currently have office 2010 installed, and am trying to assist a coworker who's still using 2007 with VSTO solution. This is turning into a mess since my copy of visual studio thrashes the project files updating them to point to the O2010 dlls. If I were to install office 2007 beside 2010 would I be able to open the solution without the upgrade wizard mangling everything, or are my only options making significant architectural changes to the solution or reverting to O2007 until my employer makes O2010 the new standard.

Community
  • 1
  • 1
  • I don't think there is a good solution to your problem. What you should be able to do is work on the 2010-converted version on your machine, and simply make sure to avoid committing back the files that differ between both (I think the changes are limited to the csproj file, a diff should show you what the differences are). – Mathias May 15 '12 at 15:36
  • @Mathias that's a fallback option; but I've accidentally committed/seen coworkers commit enough local test app.config files over the years to know that's not a foolproof solution. Also, the .vbproj file isn't the only thing the wizard affects. It also insists on renaming MyTemplate.dotx to MyTemplate1.dotx. – Dan Is Fiddling By Firelight May 15 '12 at 15:43

3 Answers3

2

You cannot run Outlook versions side-by-side (and here).

You can still target both 2007 and 2010, but you need to research embedded interop types.

Community
  • 1
  • 1
SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
  • Either your answer doesn't cover my problem or I'm missing something fundamental (with all the blog posts I've found having been written by people who already understand this for people who already understand it this is quite possible). Embed Interop Types is set to true and the binaries my coworker build on his office 2007 box worked on my 2010 box. The problem is that as soon as I open the solution the upgrade wizard runs changes all the references from v12 to v14 and renames the word file from foo.dotx to foo1.dotx. – Dan Is Fiddling By Firelight May 15 '12 at 14:12
  • If I set visual studio to not do an automatic upgrade of the project file it fails to open it; apparently because I don't have the office 2007 installed. This is what triggered my original question. – Dan Is Fiddling By Firelight May 15 '12 at 14:15
  • 1
    @SliverNinja Dan's question is about supporting both Office 2007 and 2010 *Visual Studio solutions* on a developer's machine, not targeting the add-in for multiple versions of Office. – Keith May 15 '12 at 14:28
  • My VSTO project isn't targeting outlook, so that's not a concern. – Dan Is Fiddling By Firelight May 15 '12 at 15:31
2

You shouldn't need to install Office 2007 to create Office 2007 add-ins. I think the problem here is that you're missing the proper VSTO components.

Make sure you've installed the following:

If any of these are already installed then I recommend repairing their installations.

Keith
  • 20,636
  • 11
  • 84
  • 125
1

Try disabling this option:

Options > Office Tools > Project Upgrade > Always upgrade to installed version of Office (more info here)

I don't think this solves the root problem which is that you shouldn't even be prompted to upgrade your project. I still suspect that there is something wrong with the installation of your VSTO-related components (see my other answer for that info). However this may be an easy workaround.

To be clear, you can develop Office 2007 add-ins without having Office 2007 installed. I'm doing so right now without having to follow this workaround.

Keith
  • 20,636
  • 11
  • 84
  • 125