Visual Studio makes upgrading C++ projects between toolset versions straightforward for most codebases. Projects created in Visual Studio 2010 through 2017 typically open and build in the latest Visual Studio with only a retargeting step. The key insight is that Visual Studio 2015 through 2026 all use MSVC build tools with major version 14 (v140–v145), and binaries produced by these toolsets are binary-compatible — you can link object files and libraries built with any of these versions without recompilation. Understanding what has changed between versions, and which automated tools can help, makes the upgrade process significantly less daunting.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MicrosoftDocs/cpp-docs/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start: Retargeting Your Project
When you open an older.vcxproj or .sln in a newer Visual Studio, a Retarget Projects dialog appears, offering to upgrade the Platform Toolset and Windows SDK version.
Open the Solution
Open your
.sln file in the latest Visual Studio. If the Retarget dialog does not appear, right-click the solution in Solution Explorer → Retarget Solution.Select Toolset and SDK
Choose the latest Platform Toolset (e.g.,
v143 for VS 2022, v145 for VS 2026) and the latest installed Windows SDK version.Build and Address Errors
Build the solution. Most projects compile cleanly. Remaining errors typically fall into a few categories: deprecated functions, stricter conformance, changed standard library behavior, or removed Win32 APIs.
Binary Compatibility: Visual Studio 2015–2026
One of the most significant improvements in modern MSVC is ABI stability across major releases. All toolsets from VS 2015 (v140) through VS 2026 (v145) produce binaries that can be linked together without recompilation, provided you use dynamically linked CRT (/MD).
Restrictions on Binary Compatibility
Linker version must be ≥ all input binaries
Linker version must be ≥ all input binaries
When linking binaries built with different toolset versions, the linker must be at least as new as the newest component. For example, if you have a library from VS 2019 (v142) and an app from VS 2017 (v141), you must link with VS 2019 or later.
/GL and /LTCG break compatibility
/GL and /LTCG break compatibility
Object files and static libraries compiled with
/GL (Whole Program Optimization) or linked with /LTCG are only compatible with the exact same build tools version — including minor updates. Even a patch release can cause linker error C1047.Upgrading from Visual Studio 2008 and Earlier
For projects predating VS 2010, use the two-step approach:VCBuild (
.vcproj format from VS 2008 and earlier) cannot be directly imported by VS 2015 or later. VS 2010 performs the conversion to MSBuild format, which all modern versions support.Common Porting Issues
Deprecated CRT Functions
MSVC deprecates POSIX-named CRT functions (without the underscore prefix) and classic unsafe functions:Stricter Conformance — /permissive-
VS 2017 and later default to stricter C++ conformance mode. Code that relied on MSVC extensions may fail to compile:
Changed std:: Behavior
Some standard library implementations became stricter or changed behavior:
Pragma and __declspec Changes
Universal CRT Upgrade
VS 2015 split the legacymsvcr120.dll into the Universal CRT (ucrtbase.dll) and vcruntime140.dll. Code that directly called internal CRT symbols may break:
IDE Tools for Upgrading
Visual Studio provides several tools to assist upgrades:Upgrade Wizard
Right-click solution → Retarget Solution to change the Platform Toolset and Windows SDK version across all projects at once.
Error List Filtering
Use the Error List Search box to filter errors by warning code (e.g.,
C4996) and address them systematically./analyze (Code Analysis)
Enable static analysis with
/analyze to catch deprecated patterns, security issues, and conformance problems before they become runtime errors.Dependency Walker
Use
dumpbin /dependents myapp.exe or Dependency Walker to verify which runtime DLLs your upgraded binary requires.GitHub Copilot Modernization for C++
Visual Studio 2026 includes GitHub Copilot modernization for C++, an AI agent that automates the upgrade workflow. It upgrades project settings, builds the project, analyzes errors, proposes fixes, and iterates until the build succeeds.Enable the Feature
Copilot modernization is enabled by default in VS 2026. To toggle it: Tools → Options → All Settings → GitHub → Copilot → C/C++ → check Enable GitHub Copilot modernization for C++ (preview).
Start the Modernize Agent
Right-click your solution in Solution Explorer → Modernize. This opens GitHub Copilot Chat with the agent pre-activated and ready-to-use prompts displayed.Alternatively, open Copilot Chat (View → GitHub Copilot Chat) and type:
GitHub Copilot modernization for C++ supports both MSBuild-based projects (
.sln, .vcxproj) and CMake-based projects. It requires a GitHub Copilot subscription and Visual Studio 2026 version 18.3 or later. The feature is currently in preview.