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.
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:
Code that no longer compiles cleanly due to compiler conformance improvements or changes in the standard
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
Code that no longer compiles due to changes in APIs such as renamed APIs, changed function signatures, or deprecated functions
Code that no longer compiles due to changes in diagnostics, such as a warning becoming an error
Linker errors due to libraries that were changed, especially when /NODEFAULTLIB is used.
Runtime errors or unexpected results due to behavior changes
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.
- Set the Platform Toolset, C++ Language Standard, and Windows SDK version (if applicable) to the desired versions. (Project > Properties > Configuration Properties > General)
- 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.
- Ensure that all dependencies are present and that the include paths or library locations are correct. (Project > Properties > Configuration Properties > VC++ Directories)
- Identify and fix errors due to references to APIs that no longer exist.
- Fix any remaining errors that prevent compilation. Refer to Overview of potential upgrade issues for fixes for common errors.
- Turn permissive- back on and fix any new errors that appear due to non-conformant code that previously compiled in MSVC.
- 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.
- 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