Skip to content

Commit 6975ddd

Browse files
Docs for GitHub Copilot app modernization for C++ (#6221)
* Documentation for using GitHub Copilot app modernization for C++ features * Adding a link to the GitHub Copilot app modernization for C++ documentation to the porting and upgrading page. * first style pass * edit pass * Minor-ish grammatical changes * Removing line about working in solutions that have mixed languages. The default should be to assume that it does anyways. * Adding some screenshots for enabling and getting started with app modernization. * Attempt to get side-by-side images of the ice breakers for both MSBuild and CMake projects * Bring the link for app modernization down into the upgrade & modernize section instead of it's own section. * Fixing typo in image file name * Addressing several of @TylerMSFT's review comments * Adjusting the ice breaker section to be clearer about the role of each image and why they should be laid out next to each other and fixing the images to be roughly the same size so that they present in a way that isn't too jarring. * Shortening and clarifying the names of the images showing the ice breakers * Renaming file so that ghcp turns into copilot which is a bit less confusing if someone is looking at file names. * Missed one place where the filename needed to be updated * Renaming images to fully spell out modernization * Removing 'public' from 'public preview' and adding a period at the end of a sentence on the same line as one of those changes * Removing the hyphen from 'pre-existing' to make it simply 'preexisting' * Rewording to avoid unnecessary repetition between the first and second sentence. * Removing Insiders descriptor from the requirements section, as it becomes an irrelevant detail in a short period of time. * Adding a link to the documentation for the new retarget projects experience. --------- Co-authored-by: TylerMSFT <TylerMSFT@users.noreply.github.com>
1 parent 56ec8fb commit 6975ddd

7 files changed

Lines changed: 103 additions & 0 deletions
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: "Modernize your C++ project with GitHub Copilot app modernization"
3+
description: "Instructions on effectively using GitHub Copilot app modernization in your C++ projects"
4+
ms.date: 01/23/2026
5+
ms.topic: upgrade-and-migration-article
6+
author: michaelbprice
7+
ms.author: miprice
8+
---
9+
10+
# Using GitHub Copilot app modernization for C++
11+
12+
GitHub Copilot app modernization for C++ helps you upgrade C++ projects to newer MSVC Build Tools versions. If necessary, Copilot will upgrade your project's settings to use the latest MSVC, and then conduct a thorough assessment of the impact of those changes after executing a build. It develops a plan on how to address each identified problem. Once you approve the plan, the agent completes a sequence of tasks and validates that any changes resolved the identified problems. If there remains work to be done, the agent continues iterating until the problems are resolved or you discontinue the conversation.
13+
14+
> [!NOTE]
15+
> GitHub Copilot app modernization for C++ is currently in preview.
16+
17+
## Requirements
18+
19+
- Visual Studio 2026 version 18.3 or later
20+
- A GitHub Copilot account
21+
- A MSBuild-based codebase (`.sln`, `.vcxproj`) OR a CMake-based codebase
22+
23+
## Enable GitHub Copilot app modernization for C++
24+
25+
GitHub Copilot app modernization for C++ is enabled by default. To disable or explicitly enable the feature, follow these steps.
26+
27+
1. From Visual Studio, select **Tools > Options...** to open the **Options** window.
28+
1. Navigate to **All Settings > GitHub > Copilot > C/C++**.
29+
1. Select (to enable) or clear (to disable) the checkbox for **Enable GitHub Copilot app modernization for C++ (preview)**.
30+
1. Restart Visual Studio for the setting change to take effect.
31+
32+
![Screenshot of the settings to enable GitHub Copilot app modernization for C++.](media/enable-copilot-app-modernization-cpp.png "enable GitHub Copilot app modernization for C++")
33+
34+
## Upgrade your codebase by using GitHub Copilot app modernization for C++
35+
36+
This section describes how to start the Modernize agent and the stages it goes through to upgrade your codebase.
37+
38+
### Start the Modernize agent
39+
40+
GitHub Copilot app modernization is an agent that operates inside the GitHub Copilot Chat window. You can start the agent in any of the following ways:
41+
42+
- **From the Solution Explorer context menu**: Right-click on the solution or a loaded project in the Solution Explorer, and choose **Modernize** from the context menu. This automatically launches a GitHub Copilot Chat window, activates the Modernize agent, and provides you with relevant prompts to choose from to get you started.
43+
44+
![Screenshot of the context menu to start GitHub Copilot app modernization.](media/copilot-app-modernization-context-menu.png "Start GitHub Copilot app modernization")
45+
46+
- **From GitHub Copilot Chat**: Open the GitHub Copilot Chat Window by selecting **View > GitHub Copilot Chat**. After the GitHub Copilot Chat window opens, mention `@Modernize` in a prompt to activate the Modernize agent. For example, type this prompt:
47+
48+
`Use @Modernize to update MSVC Build Tools.`
49+
50+
#### For MSBuild-based codebases targeting an earlier version of MSVC Build Tools
51+
52+
The first time that you load a `.vcxproj` project that targets an earlier version of the MSVC Build Tools, you see an option to [upgrade project settings to use a newer version of the MSVC Build Tools](https://learn.microsoft.com/visualstudio/install/setup-assistant). If you retarget any of your projects to a new version of MSVC Build Tools and GitHub Copilot app modernization for C++ is enabled, you receive an infobar in Visual Studio prompting you to use GitHub Copilot app modernization for C++ to resolve any newly introduced build problems. Selecting **Run GitHub Copilot app modernization for C++** launches the GitHub Copilot Chat window, activates the Modernize agent, and provides you with relevant prompts to choose from to get you started.
53+
54+
### Start the upgrade
55+
56+
Once the Modernize agent is active, you can instruct it via a prompt to upgrade your MSVC Build Tools, or select the already constructed prompt from the list shown in the window. If you launched the agent directly in the GitHub Copilot Chat window by mentioning @Modernize in your prompt, you probably don't need to provide any additional prompting.
57+
58+
:::row:::
59+
:::column:::
60+
61+
**MSBuild Projects**
62+
63+
:::column-end:::
64+
:::column:::
65+
66+
**CMake Projects**
67+
68+
:::column-end:::
69+
:::row-end:::
70+
:::row:::
71+
:::column:::
72+
73+
![Screenshot of GitHub Copilot app modernization window with MSVC upgrade ice breaker for an MSBuild project.](media/app-modernization-msbuild-ice-breaker.png "GitHub Copilot app modernization window")
74+
75+
:::column-end:::
76+
:::column:::
77+
78+
![Screenshot of GitHub Copilot app modernization window with MSVC upgrade ice breaker for a CMake project.](media/app-modernization-cmake-ice-breaker.png "GitHub Copilot app modernization window")
79+
80+
:::column-end:::
81+
:::row-end:::
82+
83+
84+
### Assessment stage
85+
86+
The agent first assesses what kinds of problems show up after upgrading. If you didn't already upgrade the project, the agent guides you through that process before creating its assessment. After ensuring that your project is upgraded, the agent builds your codebase, analyzes the reported warnings and errors, and generates an `assessment.md` file that describes the problems that it found, their severity, and other useful information. This is your opportunity to tell the agent any additional context that could help it make a plan.
87+
88+
One of the things you might choose to do here is to tell the agent not to fix certain discovered problems, because you know that resolving them involves some strategic decisions or because they were preexisting warnings that you decided are acceptable for your project. You should carefully read through the plan, making sure to provide that additional context where it is needed. Once you approve the assessment, the agent moves on to creating a concrete plan on addressing the problems.
89+
90+
### Planning stage
91+
92+
Based on the approved assessment and any additional context or instructions you provide, the agent creates a `plan.md` file that proposes a detailed plan for resolving each of the identified problems. If the agent produces a plan that doesn't match your organization's coding style or practices, you can provide that guidance to the agent and have it solve the problem differently. After you agree on the plan, the agent moves to the execution stage.
93+
94+
### Execution stage
95+
96+
Now that the agent has a plan, it breaks down the necessary tasks to execute the plan. You can define these tasks as finely as you want. The tasks can even include steps to work on a branch or to commit specific changes together in the same commit. After making any changes, the agent builds the project again to confirm that the problems are resolved. If the problems aren't resolved, the agent iterates with you until they're resolved to your satisfaction.
97+
98+
### Post-upgrade validation
99+
100+
When the agent finishes, run the changes through any testing infrastructure you have. Have a colleague review the changes in a pull request. Since this feature is currently in preview, you might receive an infobar to complete a product survey to let the product team know how the agent performed on your codebase. The product team looks forward to hearing how they can improve the agent to solve your problems and accelerate your upgrade and modernization efforts.
188 KB
Loading
90.2 KB
Loading
49.1 KB
Loading
57.9 KB
Loading

docs/porting/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ items:
99
href: ../porting/overview-of-potential-upgrade-issues-visual-cpp.md
1010
- name: Upgrade your code to the Universal CRT
1111
href: ../porting/upgrade-your-code-to-the-universal-crt.md
12+
- name: Modernize your C++ project with GitHub Copilot app modernization
13+
href: ../porting/copilot-app-modernization-cpp.md
1214
- name: Update WINVER and _WIN32_WINNT
1315
href: ../porting/modifying-winver-and-win32-winnt.md
1416
- name: Fix your dependencies on library internals

docs/porting/visual-cpp-porting-and-upgrading-guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ ms.author: twhitney
6161

6262
- [⬆️ Upgrading C++ Projects to Visual Studio 2026](https://devblogs.microsoft.com/cppblog/upgrading-c-projects-to-visual-studio-2026/)
6363
- [⬆️ Upgrade projects from earlier versions](upgrading-projects-from-earlier-versions-of-visual-cpp.md)
64+
- [🤖 Upgrade with an AI agent (preview)](copilot-app-modernization-cpp.md)
6465
- [🛠️ IDE tools for upgrading C++ code](ide-tools-for-upgrading-code.md)
6566
- [🔄 Upgrade to Universal CRT](upgrade-your-code-to-the-universal-crt.md)
6667
- [🔧 Update WINVER and _WIN32_WINNT](modifying-winver-and-win32-winnt.md)

0 commit comments

Comments
 (0)