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.
-
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 Answers
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.

- 1
- 1

- 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
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:
- All .NET and developer tools from Office (from the Office 2010 installer -- no need for the Office 2007 installer)
- Microsoft Office Developer Tools from Visual Studio (from the VS installer)
- Microsoft Office 2007 Primary Interop Assemblies
- Microsoft Visual Studio 2010 Tools for Office Runtime
- Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime)
If any of these are already installed then I recommend repairing their installations.

- 20,636
- 11
- 84
- 125
-
I installed both of those and I'm still unable to open the project without VS converting it to office2010. – Dan Is Fiddling By Firelight May 15 '12 at 15:20
-
Dan, I just updated my answer to include a couple of other components. I also recommend repairing the installations of the components that are already installed. – Keith May 15 '12 at 16:01
-
The VSTO3.0 installer can't run a repair install because another version (4.0) is installed. – Dan Is Fiddling By Firelight May 15 '12 at 17:22
-
As a sanity check, do I want the x86 VSTO 2010 runtime (for 32bit office), or the x64 version (for win64)? – Dan Is Fiddling By Firelight May 15 '12 at 17:24
-
Choose whichever is suited for your OS, depending on whether its 32 or 64 bit. – Keith May 15 '12 at 23:01
-
If you're still at a loss, perhaps you should uninstall VSTO 4, repair VSTO 3, then reinstall VSTO 4. – Keith May 15 '12 at 23:01
-
VSTOR3.0 blocks on more components than just VSTOR4. I uninstalled the latter, but the former still fails because it thinks there's a newer version present. I can't even uninstall 3.0 for the same reason. Repair installs of O2010 and VS2010 didn't fix anything. – Dan Is Fiddling By Firelight May 16 '12 at 14:59
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.

- 20,636
- 11
- 84
- 125
-
I did. The project with the word template fails to load. Grayed out, prefixed (unavailable), and with "The project file cannot be loaded" as the only child in the tree. – Dan Is Fiddling By Firelight May 16 '12 at 14:53