Share via


Upgrading and Migrating Office Solutions

If you have a Microsoft Office project that was created in an earlier version of Visual Studio, you must upgrade the project to use it in Visual Studio 2012. To upgrade a Microsoft Office project, open it in a version of Visual Studio 2012 that includes the Microsoft Office developer tools. For more information about the upgrade process, see How to: Upgrade Office Solutions. For more information about the versions of Visual Studio 2012 that include the Microsoft Office developer tools, see Configuring a Computer to Develop Office Solutions.

When you upgrade a Microsoft Office project, Visual Studio makes several changes to the project. Some of the changes depend on the version of the .NET Framework and Microsoft Office that you have installed on the development computer, and whether the project is a document-level project or an application-level project.

Note

Visual Studio 2012 cannot upgrade InfoPath form template projects that were created by using previous versions of Visual Studio. These types of projects are not supported in Visual Studio 2012.

Supported Project Upgrade Versions

You can upgrade Office projects created by using any of the following versions of Office tools in Visual Studio.

  • Microsoft Visual Studio 2005 Tools for the Microsoft Office System.

  • Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System (VSTO 2005 SE).

  • Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0). This version of Visual Studio Tools for Office was included with Visual Studio 2008.

  • Microsoft Office developer tools in Visual Studio 2010.

Visual Studio 2012 does not support upgrading Microsoft Office projects created by using Visual Studio Tools for Office, Version 2003. To continue to develop one of these projects in Visual Studio 2012, create a new Office project and manually port your code into the new project.

Note

Visual Studio Tools for Office was the name of the Microsoft Office developer tools in previous versions of Visual Studio.

Changes to Upgraded Projects

When you upgrade a Microsoft Office project, Visual Studio modifies the project to target the following items:

  • The Visual Studio 2010 Tools for Office Runtime. For more information, see Visual Studio Tools for Office Runtime Overview.

  • A version of the .NET Framework that is supported by the project type.

  • A version of Microsoft Office that is supported by the project type.

  • The current assembly references.

Targeted .NET Framework

When you upgrade a project in Visual Studio 2012, Visual Studio modifies the project to target the .NET Framework 4. The .NET Framework 4 is installed automatically when you install Visual Studio 2012.

If you install the Microsoft Office Developer Tools for Visual Studio 2012 and then upgrade a project in Visual Studio 2012, Visual Studio modifies the project to target either the .NET Framework 4.5 or the .NET Framework 4. The version of the .NET framework targeted by the project depends on what version of Office is installed on your computer. If Office 2013 is installed, Visual Studio modifies the project to target the .NET Framework 4.5. Otherwise, Visual Studio modifies the project to target the .NET Framework 4. Office solutions can target the .NET Framework 4.5 only if you install the Microsoft Office Developer Tools for Visual Studio 2012. See “Tools” on the Download Page.

Note

You might need to perform some additional steps to run a retargeted solution on development and end-user computers, and your project will no longer compile if it uses certain features. For more information, see Migrating Office Solutions to the .NET Framework 4 or the .NET Framework 4.5.

If you target the .NET Framework 4 or the .NET Framework 4.5 in an Office project, you can use some features that are not available when you target the .NET Framework 3.5. For more information, see Designing and Creating Office Solutions.

Targeted Office Application

When you upgrade an Office project, Visual Studio modifies the project to target a version of the Microsoft Office that is supported by the project type, such as a document-level customization project or application-level add-in project.

Office projects in Visual Studio 2012 can target only Office 2013 and Office 2010 applications. If Office 2013 is installed, Visual Studio modifies the project to target Office 2013. If Office 2010 is installed, Visual Studio modifies the project to target Office 2010. If neither version of Office is installed, Visual Studio 2012 does not upgrade the project.

Note

If you upgrade an add-in project to target Office 2013, make sure that the ThisAddIn_Startup event handler of the add-in doesn’t contain code that accesses a document in the application. For more information, see Accessing a Document when the Office Application Starts.

For document-level customizations, Visual Studio converts documents in a project that have a binary format, such as documents that have an .xls or .doc extension, to the Office Open XML format. For more information about Open XML, see Introduction to new file name extensions and Open XML Formats.

Note

Smart tags are deprecated in Excel 2010 and Word 2010. Therefore, if your solution uses smart tags, you must remove them before you can test and debug it in Visual Studio 2012.

Assembly References

Visual Studio upgrades the following assembly references in the project:

  • Microsoft Office primary interop assemblies (PIAs).

  • Assemblies in the Visual Studio Tools for Office runtime. For more information about these assemblies, see Visual Studio Tools for Office Runtime Overview.

  • New or updated versions of dependent assemblies.

Visual Studio does not add references to new or updated versions of assemblies that you added to the original project after it was created. For example, if you upgrade a Word 2003 add-in project that also references the PowerPoint 2003 primary interop assembly, Visual Studio modifies the upgraded project to reference the Word 2010 primary interop assembly. However, you must manually update the reference to the PowerPoint primary interop assembly.

Upgrading Microsoft Office 2003 Projects

There are some additional considerations for upgrading document-level customizations and application-level add-ins that target Microsoft Office 2003.

Document-Level Projects

If the document in the project contains Windows Forms controls, you must also have the Visual Studio 2005 Tools for Office Second Edition Runtime installed before you upgrade the project. If this version of the runtime is not installed on the development computer before you upgrade the project, the upgraded project might contain compile or run time errors. After you finish upgrading the project, you can uninstall the Visual Studio 2005 Tools for Office Second Edition Runtime from the development computer if it is not being used by any other Office solutions. This version of the runtime is available as a redistributable package from the Microsoft Download Center at Microsoft Visual Studio 2005 Tools for Office Second Edition Runtime (VSTO 2005 SE) (x86).

Application-Level Projects

If the solution file for your original project included a Setup or InstallShield Limited Edition project that was configured to install the application-level add-in, Visual Studio upgrades the project to a Visual Studio 2012 project, but it does not make any further changes to the project. If you want to keep using a Windows Installer file to deploy your add-in, you must modify the Setup or InstallShield Limited Edition project to install new pre-requisites such as the .NET Framework 4, the Visual Studio 2010 Tools for Office Runtime, and optionally the primary interop assemblies referenced by your add-in. For more information, see Deploying an Office Solution by Using Windows Installer.

If you want to use ClickOnce to deploy your add-in, you can delete the Setup or InstallShield Limited Edition project entirely. For more information about deploying add-ins by using ClickOnce, see Deploying an Office Solution.

See Also

Tasks

How to: Upgrade Office Solutions

Reference

Project Upgrade, Options Dialog Box

Concepts

Migrating Office Solutions to the .NET Framework 4 or the .NET Framework 4.5