|
| 1 | +--- |
| 2 | +title: GitHub Copilot app modernization - upgrade for .NET Overview |
| 3 | +description: "Learn more about GitHub Copilot app modernization - upgrade for .NET. This Visual Studio extension helps you upgrade your code and projects. Upgrades can include .NET versioning or migrating code from one technology to another." |
| 4 | +titleSuffix: "" |
| 5 | +author: adegeo |
| 6 | +ms.author: adegeo |
| 7 | +ms.topic: overview |
| 8 | +ms.date: 05/16/2025 |
| 9 | + |
| 10 | +#customer intent: As a developer, I want to upgrade my project so that I can take advantage of the latest features. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +# What is GitHub Copilot app modernization - upgrade for .NET? |
| 15 | + |
| 16 | +GitHub Copilot app modernization - upgrade for .NET is a powerful Visual Studio extension that works with you to upgrade projects to newer versions of .NET, upgrade your dependencies, and applies code fixes. |
| 17 | + |
| 18 | +GitHub Copilot app modernization is distributed as a Visual Studio extension, and is an interactive upgrade process. |
| 19 | + |
| 20 | +## Prerequisites |
| 21 | + |
| 22 | +- Windows Operating System |
| 23 | +- [Visual Studio 2022 version 17.14 or newer](https://visualstudio.microsoft.com/downloads/). |
| 24 | +- [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#change-workloads-or-individual-components). |
| 25 | +- [Sign in to Visual Studio using a GitHub account](/visualstudio/ide/work-with-github-accounts) with [Copilot access](https://docs.github.com/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot). |
| 26 | + - You can use [GitHub Copilot for free](/visualstudio/ide/copilot-free-plan). |
| 27 | +- Code must be in a local Git repository. |
| 28 | +- Code must be written in C#. |
| 29 | +- Optional but recommended: Use **GitHub Copilot agent mode** for the upgrade process. For more information, see [Use Copilot agent mode in Visual Studio](/visualstudio/ide/copilot-agent-mode?view=vs-2022&preserve-view=true). |
| 30 | + |
| 31 | +For installation instructions, see [Install GitHub Copilot app modernization - upgrade for .NET](github-copilot-app-modernization-install.md). |
| 32 | + |
| 33 | +## Supported project types |
| 34 | + |
| 35 | +GitHub Copilot app modernization supports upgrading projects coded in C#. The following types of projects are supported: |
| 36 | + |
| 37 | +- ASP.NET and related technologies such as MVC, Razor Pages, Web API |
| 38 | +- Blazor |
| 39 | +- Azure Functions |
| 40 | +- Windows Presentation Foundation |
| 41 | +- Windows Forms |
| 42 | +- Class libraries |
| 43 | +- Console apps |
| 44 | + |
| 45 | +> [!IMPORTANT] |
| 46 | +> The current version of the extension doesn't support upgrading from .NET Framework to .NET. In these scenarios, use the [.NET Upgrade Assistant](upgrade-assistant-overview.md) to migrate to .NET, then use this tool to modernize your code. |
| 47 | +
|
| 48 | +## Upgrade paths |
| 49 | + |
| 50 | +The following upgrade paths are supported: |
| 51 | + |
| 52 | +- Upgrade projects from .NET Core to .NET. |
| 53 | +- Upgrade projects from older versions of .NET to the latest. |
| 54 | +- Modernize your code base. |
| 55 | + |
| 56 | +## Start the upgrade process |
| 57 | + |
| 58 | +The first step to upgrading is generating a plan by interacting with GitHub Copilot. There are two ways to get Copilot to use the tool: |
| 59 | + |
| 60 | +- Right-click on the solution or project and select **Upgrade with GitHub Copilot**. |
| 61 | + |
| 62 | + —or— |
| 63 | + |
| 64 | +- [Enable GitHub Copilot agent mode](/visualstudio/ide/copilot-agent-mode?view=vs-2022&preserve-view=true), and ask a new Copilot chat to upgrade the solution or project. |
| 65 | + |
| 66 | + > [!IMPORTANT] |
| 67 | + > After enabling GitHub Copilot agent mode, set the chat mode to **Agent** and enable the **upgrade_start** tool. |
| 68 | + > |
| 69 | + > :::image type="content" source="media/github-copilot-app-modernization-overview/copilot-agent-tools.png" alt-text="The GitHub Copilot chat window. The Agent Mode dropdown and Tool selection dropdown are both highlighted."::: |
| 70 | +
|
| 71 | +## Generate a plan |
| 72 | + |
| 73 | +Once the process starts, Copilot analyzes your projects and their dependencies, and then asks you a series of questions about the upgrade. After you answer these questions, an upgrade plan is written in the form of a markdown file. If you tell Copilot to proceed with the upgrade, this plan describes the steps of the upgrade process. |
| 74 | + |
| 75 | +You can adjust the plan by editing the markdown file to change the upgrade steps or add more context. |
| 76 | + |
| 77 | +> [!CAUTION] |
| 78 | +> The plan is generated based on the inter-dependencies of your projects. You can prevent the upgrade from succeeding if you modify the plan in such a way that the migration path can't complete. For example, if **Project A** depends on **Project B** and you remove **Project B** from the upgrade plan, upgrading **Project A** might fail. |
| 79 | +
|
| 80 | +The following snippet demonstrates the structure of a plan: |
| 81 | + |
| 82 | +```md |
| 83 | +# .NET 9.0 Upgrade Plan |
| 84 | + |
| 85 | +## Execution Steps |
| 86 | + |
| 87 | +1. Validate that an .NET 9.0 SDK required for this upgrade is installed on the machine and if not, help to get it installed. |
| 88 | +2. Ensure that the SDK version specified in global.json files is compatible with the .NET 9.0 upgrade. |
| 89 | +3. Upgrade projects to .NET 9.0. |
| 90 | + - 3.1. Upgrade RazorMovie.csproj |
| 91 | + - 3.2. Upgrade RazorMovie.Tests.csproj |
| 92 | +4. Run unit tests to validate upgrade in the projects listed below: |
| 93 | + - RazorMovie.Tests.csproj |
| 94 | + |
| 95 | +## Settings |
| 96 | + |
| 97 | +This section contains settings and data used by execution steps. |
| 98 | + |
| 99 | +### Aggregate NuGet packages modifications across all projects |
| 100 | + |
| 101 | +NuGet packages used across all selected projects or their dependencies that need version update in projects that reference them. |
| 102 | + |
| 103 | +| Package Name | Current Version | New Version | Description | |
| 104 | +|:-------------------------------------------------|:-------------------:|:-----------:|:-------------------------| |
| 105 | +| HtmlSanitizer | 7.1.542 | 9.0.884 | Security vulnerability | |
| 106 | +| Microsoft.Data.SqlClient | 4.0.5 | 6.0.2 | Deprecated | |
| 107 | +| Microsoft.EntityFrameworkCore.Design | 6.0.0-rtm.21467.1 | 9.0.5 | Recommended for .NET 9.0 | |
| 108 | +| Microsoft.EntityFrameworkCore.SqlServer | 6.0.0-rc.1.21452.10 | 9.0.5 | Recommended for .NET 9.0 | |
| 109 | +| Microsoft.EntityFrameworkCore.Tools | 6.0.0-rc.1.21452.10 | 9.0.5 | Recommended for .NET 9.0 | |
| 110 | +| Microsoft.VisualStudio.Web.CodeGeneration.Design | 6.0.0-rc.1.21464.1 | 9.0.0 | Recommended for .NET 9.0 | |
| 111 | + |
| 112 | +... |
| 113 | +``` |
| 114 | + |
| 115 | +## Perform the upgrade |
| 116 | + |
| 117 | +Once an upgrade plan is ready, tell the Copilot to start the upgrade. Once the upgrade process starts, Copilot lets you know what it's doing in the chat window and it opens the **Upgrade Progress Details** document, which lists the status of every step. If it runs into a problem, Copilot pauses and asks for your direction or help in fixing these problems. |
| 118 | + |
| 119 | +The tool differs in experience based on whether or not Copilot _agent mode_ is enabled. |
| 120 | + |
| 121 | +- **Copilot agent mode** |
| 122 | + |
| 123 | + When Copilot agent mode is enabled and used, Copilot tries to identify the cause of a problem and apply a fix. If Copilot can't seem to correct the problem, it asks for your help. When you intervene, Copilot learns from the changes you make and tries to automatically apply them for you, if the problem is encountered again. |
| 124 | + |
| 125 | +- **Copilot fix mode** |
| 126 | + |
| 127 | + Copilot fix mode is used if agent mode is disabled or not used. Copilot reports the problems it finds and guides you through the fixes required. It relies on you to perform the actual code changes and then it verifies those fixes. |
| 128 | + |
| 129 | +Each major step in the upgrade process is committed to the local Git repository. |
| 130 | + |
| 131 | +## Upgrade results |
| 132 | + |
| 133 | +When the upgrade completes, a report is generated that describes every step of the upgrade. The tool creates a Git commit for every portion of the upgrade process, so you can easily roll back the changes or get detailed information about what changed. The report contains the Git commit hashes. |
| 134 | + |
| 135 | +The report also provides a _Next steps_ section that describes the steps you should take after the upgrade finishes. The following example shows the report of a completed upgrade that contained a test failure: |
| 136 | + |
| 137 | +```md |
| 138 | +# .NET 9 Upgrade Report |
| 139 | + |
| 140 | +## Project modifications |
| 141 | + |
| 142 | +| Project name | Old Target Framework | New Target Framework | Commits | |
| 143 | +|:-----------------------------------------------|:-----------------------:|:----------------------------:|---------------------------| |
| 144 | +| RazorMovie | net6.0 | net9.0 | af8cf633, aa61a18d | |
| 145 | +| MvcMovie | net6.0 | net9.0 | cc8c9015 | |
| 146 | +| WpfMovie | net6.0-windows | net9.0-windows | 9c4b13f9 | |
| 147 | +| RazorMovie.Tests | net6.0 | net9.0 | b8d85e97 | |
| 148 | +| MvcMovie.Tests | net6.0 | net9.0 | b8d85e97 | |
| 149 | +| WpfMovie.Tests | net6.0-windows | net9.0-windows7.0 | b8d85e97 | |
| 150 | + |
| 151 | +## NuGet Packages |
| 152 | + |
| 153 | +| Package Name | Old Version | New Version | Commit Id | |
| 154 | +|:-------------------------------------------------|:-------------------:|:-----------:|-----------| |
| 155 | +| HtmlSanitizer | 7.1.542 | 9.0.884 | af8cf633 | |
| 156 | +| Microsoft.Data.SqlClient | 4.0.5 | 6.0.2 | bf8deeac | |
| 157 | +| Microsoft.EntityFrameworkCore.Design | 6.0.0-rtm.21467.1 | 9.0.5 | bf8deeac | |
| 158 | +| Microsoft.EntityFrameworkCore.SqlServer | 6.0.0-rc.1.21452.10 | 9.0.5 | bf8deeac | |
| 159 | +| Microsoft.EntityFrameworkCore.Tools | 6.0.0-rc.1.21452.10 | 9.0.5 | bf8deeac | |
| 160 | +| Microsoft.VisualStudio.Web.CodeGeneration.Design | 6.0.0-rc.1.21464.1 | 9.0.0 | bf8deeac | |
| 161 | + |
| 162 | +## All commits |
| 163 | + |
| 164 | +| Commit ID | Description | |
| 165 | +|:----------|:--------------------------------------------------------| |
| 166 | +| af8cf633 | Update HtmlSanitizer package in RazorMovie.csproj | |
| 167 | +| aa61a18d | Upgrade target framework in RazorMovie.csproj | |
| 168 | +| cc8c9015 | Upgrade to .NET 9 and update dependencies | |
| 169 | +| bf8deeac | Update package references in MvcMovie.csproj | |
| 170 | +| 9c4b13f9 | Update WpfMovie.csproj to target .NET 9.0 | |
| 171 | +| b8d85e97 | Update test projects to .NET 9 and enhance dependencies | |
| 172 | + |
| 173 | +## Test Results |
| 174 | + |
| 175 | +| Project Name | Passed | Failed | Skipped | |
| 176 | +|:-----------------------|:------:|:------:|:-------:| |
| 177 | +| RazorMovie.Tests | 0 | 0 | 0 | |
| 178 | +| MvcMovie.Tests | 2 | 0 | 0 | |
| 179 | +| WpfMovie.Tests | 6 | 1 | 0 | |
| 180 | + |
| 181 | +## Next steps |
| 182 | + |
| 183 | +- Review the test results and address the single failing test in `WpfMovie.Tests`. |
| 184 | +- Ensure all updated NuGet packages are compatible with your application. |
| 185 | +- Leverage new features and improvements in .NET 9.0 for your projects. |
| 186 | +``` |
| 187 | + |
| 188 | +## Telemetry |
| 189 | + |
| 190 | +The tool only collects data about project types, intent to upgrade, and upgrade duration. The data is collected and aggregated through Visual Studio itself and doesn't contain any user-identifiable information. For more information about Microsoft's privacy policy, see [Visual Studio Customer Experience Improvement Program](/visualstudio/ide/visual-studio-experience-improvement-program?view=vs-2022&preserve-view=true). |
| 191 | + |
| 192 | +## Related content |
| 193 | + |
| 194 | +- [Install GitHub Copilot app modernization - upgrade for .NET](github-copilot-app-modernization-install.md) |
| 195 | +- [GitHub Copilot app modernization - upgrade for .NET FAQ](github-copilot-app-modernization-faq.yml) |
0 commit comments