VS2008 converts its own office 2003 project
Sometimes I just get so tired when I don't understand what is going on. This is one of those times;
I start VS 2008 and select to create a new Outlook 2003 c# project.
I follow the instructions given in "Deploying Visual Studio 2005 Tools for Office Second Edition Solutions Using Windows Installer: Walkthroughs (Part 2 of 2)" (http://msdn2.microsoft.com/en-us/library/bb332052.aspx)
I save and build the project. It works fine. I move the installer files to a testing machine and install, and it installs and runs fine.
Now, I go back to my development machine and close VS 2008. I then double-click on the solution, and the Conversion Wizard fires up! After it has "successfully" conveted the project, it's no longer a viable Outlook 2003 project. Argh!
Why does this happen? Is it a bug or a feature or something I just don't understand? The only reason I can think of is because I have Office 2007 installed on the development machine...
Anyone have a clue to how NOT to get the project converted?
Answers
Your guess is correct - the project is being automatically migrated because you have Office 2007 installed on the development computer. Visual Studio 2008 will automatically try to upgrade Office 2003 projects to Office 2007 projects if you have Office 2007 installed on the development computer (see http://msdn2.microsoft.com/en-us/library/k2xkefex.aspx). To change this behavior, use the Always upgrade to installed version of Office option in the Office Tools->Project Upgrade node of the Tools->Options dialog box in Visual Studio. See http://msdn2.microsoft.com/en-us/library/bb625070.aspx for more details.
Note that Visual Studio 2008 supports developing VSTO projects with only one version of Office (2003 or 2007) installed at a time on the development computer. That restriction is the main reason for this default behavior - if the developer opens a 2003 project on a development computer with 2007 installed, Visual Studio assumes that the developer wants to migrate the project to a 2007 project. For more information about the explicit support for developing against one version of Office at a time on the development computer, see the following blog entry by Andrew Whitechapel (one of the technical gurus behind VSTO) : http://blogs.msdn.com/andreww/archive/2007/06/08/why-is-vs-development-not-supported-with-multiple-versions-of-office.aspx.
I hope this helps,
McLean Schofield
All Replies
Your guess is correct - the project is being automatically migrated because you have Office 2007 installed on the development computer. Visual Studio 2008 will automatically try to upgrade Office 2003 projects to Office 2007 projects if you have Office 2007 installed on the development computer (see http://msdn2.microsoft.com/en-us/library/k2xkefex.aspx). To change this behavior, use the Always upgrade to installed version of Office option in the Office Tools->Project Upgrade node of the Tools->Options dialog box in Visual Studio. See http://msdn2.microsoft.com/en-us/library/bb625070.aspx for more details.
Note that Visual Studio 2008 supports developing VSTO projects with only one version of Office (2003 or 2007) installed at a time on the development computer. That restriction is the main reason for this default behavior - if the developer opens a 2003 project on a development computer with 2007 installed, Visual Studio assumes that the developer wants to migrate the project to a 2007 project. For more information about the explicit support for developing against one version of Office at a time on the development computer, see the following blog entry by Andrew Whitechapel (one of the technical gurus behind VSTO) : http://blogs.msdn.com/andreww/archive/2007/06/08/why-is-vs-development-not-supported-with-multiple-versions-of-office.aspx.
I hope this helps,
McLean Schofield
To see a 1 minute, 49 second video that demonstrates McLean's answer, see this VSTO blog entry:
Cheers,
Harry

