Upgrade C++ projects from earlier versions of Visual Studio

To upgrade a project created in Visual Studio 2008 or earlier, you must first use Visual Studio 2010 to convert the project from the VCBuild format (.vcproj) to the MSBuild format (.vcxproj). For more information, see Instructions for Visual Studio 2008.

To upgrade a project created in Visual Studio 2010 or later, simply open the project in the latest version of Visual Studio. Visual Studio offers to upgrade the project to the current schema. If you choose No, and you have the older version of Visual Studio on your computer, you can work in the project in a newer version of Visual Studio and continue to target the older toolset. For example, if your project must continue to run on Windows XP, you can upgrade it to Visual Studio 2019, but you have to specify the toolset as v141 or earlier. For more information, see Use native multi-targeting in Visual Studio to build old projects. If you choose Yes, then the project will be converted and cannot be converted back to the earlier version. Therefore, in upgrade scenarios, it is good practice to make a copy of the existing project and solution files.

Upgrade reports

When you upgrade a project, you get an upgrade report, which is also saved in your project folder as UpgradeLog.htm. The upgrade report shows a summary of what problems were encountered and some information about changes that were made, including:

  1. Project properties

  2. Include files

  3. Code that no longer compiles cleanly due to compiler conformance improvements or changes in the standard

  4. Code that relies on Visual Studio or Windows features that are no longer available or header files that either aren't included in a default installation of Visual Studio, or were removed from the product

  5. Code that no longer compiles due to changes in APIs such as renamed APIs, changed function signatures, or deprecated functions

  6. Code that no longer compiles due to changes in diagnostics, such as a warning becoming an error

  7. Linker errors due to libraries that were changed, especially when /NODEFAULTLIB is used.

  8. Runtime errors or unexpected results due to behavior changes

  9. Errors that were introduced in the tools. If you encounter an issue, report it to the Visual C++ team through your normal support channels or by using the Visual Studio C++ Developer Community page.

Some upgraded projects and solutions can be built successfully without modification. However, most projects will likely require changes to project settings as well as source code. There is no single correct way to go about fixing these, but some kind of phased approach is recommended. Before starting, review Overview of potential upgrade issues for more information on many kinds of common errors.

  1. Set the Platform Toolset, C++ Language Standard, and Windows SDK version (if applicable) to the desired versions. (Project > Properties > Configuration Properties > General)
  2. If you have a lot of errors, turn off the permissive- option (Project > Properties > Configuration Properties > C/C++ > Language) and code analysis (Project > Properties > Configuration Properties > Code Analysis) option temporarily to reduce the error count.
  3. Ensure that all dependencies are present and that the include paths or library locations are correct. (Project > Properties > Configuration Properties > VC++ Directories)
  4. Identify and fix errors due to references to APIs that no longer exist.
  5. Fix any remaining errors that prevent compilation. Refer to Overview of potential upgrade issues for fixes for common errors.
  6. Turn permissive- back on and fix any new errors that appear due to non-conformant code that previously compiled in MSVC.
  7. Turn on code analysis to identify potential problems or outdated coding patterns that are no longer considered acceptable. If code analysis flags many errors, you can turn off some of the warnings to focus on the most important ones first. The IDE can help with Quick Fixes for some kinds of issues.
  8. Consider other opportunities for modernizing the code, for example by replacing custom data structures and algorithms with those from the C++ standard library or the Boost open-source library. By using standard features, you make it easier for others to maintain the code and also have a strong confidence that the code has been well-tested and reviewed by many experts on the standards committee and the broader C++ community.

For hard-to-fix errors, try searching or posting a question on Stack Overflow or C++ Developer Community.

In this section

Overview of potential upgrade issues
Upgrade your code to the Universal CRT
Update WINVER and _WIN32_WINNT
Fix your dependencies on library internals
Floating-point migration issues
C++ features deprecated in Visual Studio 2019
VCBuild vs. MSBuild
Port 3rd-party libraries

See also

What's New for Visual C++ in Visual Studio
Visual C++ change history 2003 - 2015
Nonstandard Behavior
Port data applications