From f516f741d95769c7afd9e7aef24c469909b50626 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Sep 2025 10:40:43 -0700 Subject: [PATCH 1/6] Correct .NET Framework bug documentation for MMM format specifier genitive behavior (#48061) * Initial plan * Add .NET 8+ version notes for genitive names behavior in MMM and MMMM format specifiers Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com> * Clarify behavior of 'MMM' and 'MMMM' specifiers in .NET 8 * Update MMM and MMMM specifier documentation based on feedback - Remove version notes from MMMM as it works correctly in both .NET Framework and .NET - Update MMM to clarify it's a .NET Framework bug that was fixed in .NET Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com> * Apply suggestions from code review --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com> --- .../base-types/custom-date-and-time-format-strings.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/standard/base-types/custom-date-and-time-format-strings.md b/docs/standard/base-types/custom-date-and-time-format-strings.md index 4a69b5176bf18..99f5ed39eb290 100644 --- a/docs/standard/base-types/custom-date-and-time-format-strings.md +++ b/docs/standard/base-types/custom-date-and-time-format-strings.md @@ -70,8 +70,8 @@ In parsing operations, custom date and time format strings can be used with the | "mm" | The minute, from 00 to 59.

More information: [The "mm" Custom Format Specifier](#mmSpecifier). | 2009-06-15T01:09:30 -> 09

2009-06-15T01:45:30 -> 45 | | "M" | The month, from 1 to 12.

More information: [The "M" Custom Format Specifier](#M_Specifier). | 2009-06-15T13:45:30 -> 6 | | "MM" | The month, from 01 to 12.

More information: [The "MM" Custom Format Specifier](#MM_Specifier). | 2009-06-15T13:45:30 -> 06 | -| "MMM" | The abbreviated name of the month.

More information: [The "MMM" Custom Format Specifier](#MMM_Specifier). | 2009-06-15T13:45:30 -> Jun (en-US)

2009-06-15T13:45:30 -> juin (fr-FR)

2009-06-15T13:45:30 -> Jun (zu-ZA) | -| "MMMM" | The full name of the month.

More information: [The "MMMM" Custom Format Specifier](#MMMM_Specifier). | 2009-06-15T13:45:30 -> June (en-US)

2009-06-15T13:45:30 -> juni (da-DK)

2009-06-15T13:45:30 -> uJuni (zu-ZA) | +| "MMM" | The abbreviated name of the month. When used with "d" or "dd" specifiers, uses genitive names, except with .NET Framework. (This is known issue that's fixed in .NET.)

More information: [The "MMM" Custom Format Specifier](#MMM_Specifier). | 2009-06-15T13:45:30 -> Jun (en-US)

2009-06-15T13:45:30 -> juin (fr-FR)

2009-06-15T13:45:30 -> Jun (zu-ZA) | +| "MMMM" | The full name of the month. When used with "d" or "dd" specifiers, uses genitive names.

More information: [The "MMMM" Custom Format Specifier](#MMMM_Specifier). | 2009-06-15T13:45:30 -> June (en-US)

2009-06-15T13:45:30 -> juni (da-DK)

2009-06-15T13:45:30 -> uJuni (zu-ZA) | | "s" | The second, from 0 to 59.

More information: [The "s" Custom Format Specifier](#sSpecifier). | 2009-06-15T13:45:09 -> 9 | | "ss" | The second, from 00 to 59.

More information: [The "ss" Custom Format Specifier](#ssSpecifier). | 2009-06-15T13:45:09 -> 09 | | "t" | The first character of the AM/PM designator.

More information: [The "t" Custom Format Specifier](#tSpecifier). | 2009-06-15T13:45:30 -> P (en-US)

2009-06-15T13:45:30 -> 午 (ja-JP)

2009-06-15T13:45:30 -> (fr-FR) | @@ -427,7 +427,7 @@ The following example includes the "MM" custom format specifier in a custom form ### The "MMM" custom format specifier -The "MMM" custom format specifier represents the abbreviated name of the month. The localized abbreviated name of the month is retrieved from the property of the current or specified culture. If there is a "d" or "dd" custom format specifier in the custom format string, it is retrieved from the property instead. +The "MMM" custom format specifier represents the abbreviated name of the month. The localized abbreviated name of the month is retrieved from the property of the current or specified culture. If there is a "d" or "dd" custom format specifier in the custom format string, it is retrieved from the property instead, except in .NET Framework. (This is known issue that's fixed in .NET.) The following example includes the "MMM" custom format specifier in a custom format string. From 47eb2304be49b66208ccfa10c910efa08a99bf25 Mon Sep 17 00:00:00 2001 From: "Huang Xueyuan (Jessie)" Date: Wed, 24 Sep 2025 01:41:20 +0800 Subject: [PATCH 2/6] Update app mod .NET faq for migration to Azure (#48621) * Update app mod .NET faq for migration to Azure * Update migration scenarios in FAQ document --------- Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- .../github-copilot-app-modernization-faq.yml | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/core/porting/github-copilot-app-modernization-faq.yml b/docs/core/porting/github-copilot-app-modernization-faq.yml index db8c6cdc6df57..f678be56a7706 100644 --- a/docs/core/porting/github-copilot-app-modernization-faq.yml +++ b/docs/core/porting/github-copilot-app-modernization-faq.yml @@ -1,7 +1,7 @@ ### YamlMime:FAQ metadata: - title: GitHub Copilot app modernization - upgrade for .NET FAQ - description: "This article answers frequently asked questions about GitHub Copilot app modernization - upgrade for .NET." + title: GitHub Copilot app modernization for .NET FAQ + description: "This article answers frequently asked questions about GitHub Copilot app modernization for .NET." titleSuffix: "" author: adegeo ms.author: adegeo @@ -10,7 +10,7 @@ metadata: title: GitHub Copilot app modernization FAQ summary: | - GitHub Copilot app modernization is an interactive GitHub Copilot agent that adds powerful upgrade capabilities to Visual Studio. This article answers frequently asked questions. For more information about the modernization agent, see [What is GitHub Copilot app modernization](github-copilot-app-modernization-overview.md). + GitHub Copilot app modernization is an interactive GitHub Copilot agent that adds powerful capabilities to Visual Studio. This article answers frequently asked questions. For more information about the modernization agent, see [What is GitHub Copilot app modernization](github-copilot-app-modernization-overview.md). The tool requires one of the following GitHub Copilot subscriptions: @@ -28,8 +28,8 @@ sections: answer: | Currently, GitHub Copilot app modernization helps you upgrade your .NET (.NET, .NET Core, and .NET Framework) projects to newer versions of .NET. It also helps migrate services to Azure. It also upgrades dependencies and fixes errors in the code post-migration. The agent performs the following steps in a GitHub Copilot chat session: - - Analyzes your projects and proposes an upgrade plan. - - According to the plan, runs a series of tasks to upgrade your projects. + - Analyzes your projects and proposes an modernization plan. + - According to the plan, runs a series of tasks to modernize your projects. - Operates in a working branch under a local Git repository. - Automatically fixes issues during the code transformation. - Reports progress and allow access to code changes & logs. @@ -38,7 +38,7 @@ sections: - question: What limitations are there? answer: | - Only Git repositories are supported. - - There's no guarantee that the upgrade suggestions are considered best practices. + - There's no guarantee that the upgrade or migration suggestions are considered best practices. - The LLM doesn't persist learning from the upgrade. Meaning, code fixes and corrections you provide during the upgrade process don't persist and can't be remembered for future upgrades. - It only runs on Windows. @@ -54,7 +54,7 @@ sections: - question: Does the agent store my source code? answer: | - The agent never stores a user's codebase and never uses your code for training the model. Once an upgrade is complete, session data is deleted. + The agent never stores a user's codebase and never uses your code for training the model. Once an upgrade or migration is complete, session data is deleted. - question: Can I provide feedback? answer: | @@ -89,12 +89,26 @@ sections: questions: - question: What can the agent migrate? answer: | - The agent can assist in migrating your .NET applications to Azure, including: + The agent can assist in migrating and deploying your .NET applications to Azure, including: + - Web apps - API apps - Azure Functions - Containerized applications + The migration scenarios include: + + - Modernizing databases + - Storage + - Identity + - Messaging + - Event streaming + - Email + - Logging + - Security + + For more information about these scenarios, see [Predefined tasks for migration](github-copilot-app-modernization-overview.md#predefined-tasks-for-migration). + - question: Can I monitor assessment progress? answer: | Yes, you can monitor the progress of the assessment through the Visual Studio interface. The agent provides real-time feedback and updates on the status of the migration process. From 5f972d864e677af6cc0ef08f3a339a28b8002c7d Mon Sep 17 00:00:00 2001 From: fcdeveloper00 Date: Tue, 23 Sep 2025 11:28:21 -0700 Subject: [PATCH 3/6] Update httpclient-factory-troubleshooting.md (#48657) fixes some typos. --- .../extensions/httpclient-factory-troubleshooting.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/core/extensions/httpclient-factory-troubleshooting.md b/docs/core/extensions/httpclient-factory-troubleshooting.md index f00ae6da9624f..e61be1a959e3f 100644 --- a/docs/core/extensions/httpclient-factory-troubleshooting.md +++ b/docs/core/extensions/httpclient-factory-troubleshooting.md @@ -53,7 +53,7 @@ Even if `IHttpClientFactory` is used, it's still possible to hit the stale DNS p `HttpClient` instances created by `IHttpClientFactory` are intended to be **short-lived**. -- Recycling and recreating `HttpMessageHandler`'s when their lifetime expires is essential for `IHttpClientFactory` to ensure the handlers react to DNS changes. `HttpClient` is tied to a specific handler instance upon its creation, so new `HttpClient` instances should be requested in a timely manner to ensure the client will get the updated handler. +- Recycling and recreating `HttpMessageHandler`s when their lifetime expires is essential for `IHttpClientFactory` to ensure the handlers react to DNS changes. `HttpClient` is tied to a specific handler instance upon its creation, so new `HttpClient` instances should be requested in a timely manner to ensure the client will get the updated handler. - Disposing of such `HttpClient` instances **created by the factory** will not lead to socket exhaustion, as its disposal **does not** trigger disposal of the `HttpMessageHandler`. `IHttpClientFactory` tracks and disposes of resources used to create `HttpClient` instances, specifically the `HttpMessageHandler` instances, as soon their lifetime expires and there's no `HttpClient` using them anymore. @@ -110,9 +110,9 @@ Consider the following examples of how the link between _typed_ and _named_ clie ❌ DO NOT register the _typed client_ separately — it is already registered automatically by the `AddHttpClient` call. -If a _typed client_ is erroneously registered a second time as a plain Transient service, this will overwrite the registration added by the `HttpClientFactory`, breaking the link to the _named client_. It will manifest as if the `HttpClient`'s configuration is lost, as an unconfigured `HttpClient` will get injected into the _typed client_ instead. +If a _typed client_ is erroneously registered a second time as a plain Transient service, this will overwrite the registration added by the `IHttpClientFactory`, breaking the link to the _named client_. It will manifest as if the `HttpClient`'s configuration is lost, as an unconfigured `HttpClient` will get injected into the _typed client_ instead. -It might be confusing that, instead of throwing an exception, a "wrong" `HttpClient` is used. This happens because the "default" unconfigured `HttpClient` — the client with the name (`string.Empty`) — is registered as a plain Transient service, to enable the most basic `HttpClientFactory` usage scenario. That's why after the link gets broken and the _typed client_ becomes just an ordinary service, this "default" `HttpClient` will naturally get injected into the respective constructor parameter. +It might be confusing that, instead of throwing an exception, a "wrong" `HttpClient` is used. This happens because the "default" unconfigured `HttpClient` — the client with the name (`string.Empty`) — is registered as a plain Transient service, to enable the most basic `IHttpClientFactory` usage scenario. That's why after the link gets broken and the _typed client_ becomes just an ordinary service, this "default" `HttpClient` will naturally get injected into the respective constructor parameter. ### Different _typed clients_ are registered on a common interface @@ -122,7 +122,7 @@ In case two different _typed clients_ are registered on a common interface, they ✔️ CONSIDER registering and configuring a _named client_ separately, and then linking it to one or multiple _typed clients_, either by specifying the name in `AddHttpClient` call or by calling `AddTypedClient` during the _named client_ setup. -By design, registering and configuring a _named client_ with the same name several times just appends the configuration actions to the list of existing ones. This behavior of `HttpClientFactory` might not be obvious, but it is the same approach that is used by the [Options pattern](options.md) and configuration APIs like . +By design, registering and configuring a _named client_ with the same name several times just appends the configuration actions to the list of existing ones. This behavior of `IHttpClientFactory` might not be obvious, but it is the same approach that is used by the [Options pattern](options.md) and configuration APIs like . This is mostly useful for advanced handler configurations, for example, adding a custom handler to a _named client_ defined externally, or mocking a primary handler for tests, but it works for `HttpClient` instance configuration as well. For example, the three following examples will result in an `HttpClient` configured in the **same** way (both `BaseAddress` and `DefaultRequestHeaders` are set): @@ -148,7 +148,7 @@ services.AddHttpClient("example") .ConfigureHttpClient(c => c.DefaultRequestHeaders.UserAgent.ParseAdd("HttpClient/8.0")); ``` -This enables linking a _typed client_ to an already defined _named client_, and also linking several _typed clients_ to a single _named client_. It is more obvious when overloads with a `name` parameter are used: +This enables linking a _typed client_ to an already defined _named client_, and also linking several _typed clients_ to a single _named client_. It is more obvious when overloads with the `name` parameter are used: ```csharp services.AddHttpClient("LogClient", c => c.BaseAddress = new Uri(LogServerAddress)); @@ -165,7 +165,7 @@ services.AddHttpClient("LogClient", c => c.BaseAddress = new Uri(LogServerAddres .AddTypedClient(); ``` -However, if you _don't_ want to reuse the same _named client_, you but you still wish to register the clients on the same interface, you can do so by explicitly specifying different names for them: +However, if you _don't_ want to reuse the same _named client_, but you still wish to register the clients on the same interface, you can do so by explicitly specifying different names for them: ```csharp services.AddHttpClient(nameof(ExampleClient), From 923c341a2f52fec0e5d0ef9653fc072af2c85097 Mon Sep 17 00:00:00 2001 From: fcdeveloper00 Date: Tue, 23 Sep 2025 11:29:34 -0700 Subject: [PATCH 4/6] Update httpclient-factory.md (#48656) fixes some typo issues --- docs/core/extensions/httpclient-factory.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/core/extensions/httpclient-factory.md b/docs/core/extensions/httpclient-factory.md index f65983929a069..77b1204ec8429 100644 --- a/docs/core/extensions/httpclient-factory.md +++ b/docs/core/extensions/httpclient-factory.md @@ -185,7 +185,7 @@ The following example shows an HTTP `DELETE` request: :::code source="snippets/http/basic/ItemService.cs" id="Delete"::: -In the preceding code, the `DeleteItemAsync` method calls . Because HTTP DELETE requests typically contain no body, the `DeleteAsync` method doesn't provide an overload that accepts an instance of `HttpContent`. +In the preceding code, the `DeleteItemAsync` method calls . Because HTTP `DELETE` requests typically contain no body, the `DeleteAsync` method doesn't provide an overload that accepts an instance of `HttpContent`. To learn more about using different HTTP verbs with `HttpClient`, see . @@ -197,7 +197,7 @@ A new `HttpClient` instance is returned each time `CreateClient` is called on th Caching of handlers is desirable as each handler typically manages its own underlying HTTP connection pool. Creating more handlers than necessary can result in socket exhaustion and connection delays. Some handlers also keep connections open indefinitely, which can prevent the handler from reacting to DNS changes. -The default handler lifetime is two minutes. To override the default value, call for each client, on the `IServiceCollection`: +The default handler lifetime is two minutes. To override the default value, call for each client, on the `IHttpClientBuilder` when registering `IHttpClientFactory` in the `ServiceCollection`: ```csharp services.AddHttpClient("Named.Client") @@ -207,7 +207,7 @@ services.AddHttpClient("Named.Client") > [!IMPORTANT] > `HttpClient` instances created by `IHttpClientFactory` are intended to be **short-lived**. > -> - Recycling and recreating `HttpMessageHandler`'s when their lifetime expires is essential for `IHttpClientFactory` to ensure the handlers react to DNS changes. `HttpClient` is tied to a specific handler instance upon its creation, so new `HttpClient` instances should be requested in a timely manner to ensure the client will get the updated handler. +> - Recycling and recreating `HttpMessageHandler`s when their lifetime expires is essential for `IHttpClientFactory` to ensure the handlers react to DNS changes. `HttpClient` is tied to a specific handler instance upon its creation, so new `HttpClient` instances should be requested in a timely manner to ensure the client will get the updated handler. > > - Disposing of such `HttpClient` instances **created by the factory** will not lead to socket exhaustion, as its disposal **will not** trigger disposal of the `HttpMessageHandler`. `IHttpClientFactory` tracks and disposes of resources used to create `HttpClient` instances, specifically the `HttpMessageHandler` instances, as soon their lifetime expires and there's no `HttpClient` using them anymore. @@ -217,7 +217,7 @@ Keeping a single `HttpClient` instance alive for a long duration is a common pat It may be necessary to control the configuration of the inner used by a client. -An is returned when adding named or typed clients. The extension method can be used to define a delegate on the `IServiceCollection`. The delegate is used to create and configure the primary `HttpMessageHandler` used by that client: +An is returned when adding named or typed clients. The extension method can be called on the `IHttpClientBuilder` and passed in a delegate. The delegate is used to create and configure the primary `HttpMessageHandler` used by that client: :::code source="snippets/http/configurehandler/Program.cs" id="configurehandler"::: @@ -225,7 +225,7 @@ Configuring the `HttpClientHandler` lets you specify a proxy for the `HttpClient ### Additional configuration -There are several additional configuration options for controlling the `IHttpClientHandler`: +There are several additional configuration options for controlling the `IHttpClientBuilder`: | Method | Description | |--|--| @@ -237,16 +237,16 @@ There are several additional configuration options for controlling the `IHttpCli | | Sets the length of time that a `HttpMessageHandler` instance can be reused. Each named client can have its own configured handler lifetime value. | | | Configures a new or a previously added `SocketsHttpHandler` instance from the dependency injection container to be used as a primary handler for a named `HttpClient`. (.NET 5+ only) | -## Using IHttpClientFactory together with SocketsHttpHandler +## Using `IHttpClientFactory` together with `SocketsHttpHandler` The `SocketsHttpHandler` implementation of `HttpMessageHandler` was added in .NET Core 2.1, which allows `PooledConnectionLifetime` to be configured. This setting is used to ensure that the handler reacts to DNS changes, so using `SocketsHttpHandler` is considered to be an alternative to using `IHttpClientFactory`. For more information, see [Guidelines for using HTTP clients](../../fundamentals/networking/http/httpclient-guidelines.md). -However, `SocketsHttpHandler` and `IHttpClientFactory` can be used together improve configurability. By using both of these APIs, you benefit from configurability on both a low level (for example, using `LocalCertificateSelectionCallback` for dynamic certificate selection) and a high level (for example, leveraging DI integration and several client configurations). +However, `SocketsHttpHandler` and `IHttpClientFactory` can be used together to improve configurability. By using both of these APIs, you benefit from configurability on both a low level (for example, using `LocalCertificateSelectionCallback` for dynamic certificate selection) and a high level (for example, leveraging DI integration and several client configurations). To use both APIs: 1. Specify `SocketsHttpHandler` as `PrimaryHandler` via , or (.NET 5+ only). -1. Set up based on the interval you expect DNS to be updated; for example, to a value that was previously in `HandlerLifetime`. +1. Set up based on the interval you expect DNS to be updated; for example, to a value that was previously set in the `SetHandlerLifetime` extension method. 1. (Optional) Since `SocketsHttpHandler` will handle connection pooling and recycling, handler recycling at the `IHttpClientFactory` level is no longer needed. You can disable it by setting `HandlerLifetime` to `Timeout.InfiniteTimeSpan`. ```csharp @@ -272,9 +272,9 @@ If you need to use `HttpClient` instances in a singleton service, consider the f - Use the _named client_ approach instead, injecting `IHttpClientFactory` in the singleton service and recreating `HttpClient` instances when necessary. - If you require the _typed client_ approach, use `SocketsHttpHandler` with configured `PooledConnectionLifetime` as a primary handler. For more information on using `SocketsHttpHandler` with `IHttpClientFactory`, see the section [Using IHttpClientFactory together with SocketsHttpHandler](#using-ihttpclientfactory-together-with-socketshttphandler). -## Message Handler Scopes in IHttpClientFactory +## Message Handler Scopes in `IHttpClientFactory` -`IHttpClientFactory` creates a separate DI scope per each `HttpMessageHandler` instance. These DI scopes are separate from application DI scopes (for example, ASP.NET incoming request scope, or a user-created manual DI scope), so they will **not** share scoped service instances. Message Handler scopes are tied to handler lifetime and can outlive application scopes, which can lead to, for example, reusing the same `HttpMessageHandler` instance with same injected scoped dependencies between several incoming requests. +`IHttpClientFactory` creates a separate DI scope per each `HttpMessageHandler` instance. These DI scopes are separate from application DI scopes (for example, ASP.NET incoming request scope, or a user-created manual DI scope), so they will **not** share scoped service instances. Message Handler scopes are tied to handler lifetime and can outlive application scopes, which can lead to, for example, reusing the same `HttpMessageHandler` instance with the same injected scoped dependencies between several incoming requests. :::image type="content" source="media/httpclientfactory-scopes.png" alt-text="Diagram showing two application DI scopes and a separate message handler scope"::: From 0263a792bef2196f9dce76f3c4aee35ce45d5a2d Mon Sep 17 00:00:00 2001 From: fcdeveloper00 Date: Tue, 23 Sep 2025 11:30:14 -0700 Subject: [PATCH 5/6] Update httpclient-migrate-from-httpwebrequest.md (#48655) * Update httpclient-migrate-from-httpwebrequest.md some text improvements. * Update docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md * Update docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md * Update docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md --------- Co-authored-by: Meaghan Osagie (Lewis) --- .../httpclient-migrate-from-httpwebrequest.md | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md b/docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md index 036ac300cf0aa..26ab3600e0398 100644 --- a/docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md +++ b/docs/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest.md @@ -66,7 +66,7 @@ HttpClient client = new(); using HttpResponseMessage responseMessage = await client.PostAsync(uri, new StringContent("Hello World!")); ``` -## HttpWebRequest to HttpClient, SocketsHttpHandler migration guide +## `HttpWebRequest` to `HttpClient`, `SocketsHttpHandler` migration guide | Old API | New API | Notes | |------------------------------------------|---------|-------| @@ -120,9 +120,9 @@ using HttpResponseMessage responseMessage = await client.PostAsync(uri, new Stri | `UseDefaultCredentials` | No direct equivalent API | [Example: Setting SocketsHttpHandler Properties](#example-set-socketshttphandler-properties). | | `UserAgent` | | [Example: Set Request Headers](#example-set-common-request-headers). | -## Migrate ServicePoint(Manager) usage +## Migrate `ServicePointManager` usage -You should be aware that `ServicePointManager` is a static class, meaning that any changes made to its properties will have a global effect on all newly created `ServicePoint` objects within the application. For example, when you modify a property like `ConnectionLimit` or `Expect100Continue`, it impacts every new ServicePoint instance. +You should be aware that `ServicePointManager` is a static class, meaning that any changes made to its properties will have a global effect on all newly created `ServicePoint` objects within the application. For example, when you modify a property like `ConnectionLimit` or `Expect100Continue`, it impacts every new `ServicePoint` instance. > [!WARNING] > In modern .NET, `HttpClient` does not take into account any configurations set on `ServicePointManager`. @@ -181,19 +181,19 @@ You should be aware that `ServicePointManager` is a static class, meaning that a | `CloseConnectionGroup` | No equivalent | No workaround | | `SetTcpKeepAlive` | No direct equivalent API | [Usage of SocketsHttpHandler and ConnectCallback](#usage-of-socketshttphandler-and-connectcallback). | -## Usage of HttpClient and HttpRequestMessage properties +## Usage of `HttpClient` and `HttpRequestMessage` properties -When working with HttpClient in .NET, you have access to a variety of properties that allow you to configure and customize HTTP requests and responses. Understanding these properties can help you make the most of HttpClient and ensure that your application communicates efficiently and securely with web services. +When working with HttpClient in .NET, you have access to a variety of properties that allow you to configure and customize HTTP requests and responses. Understanding these properties can help you make the most of `HttpClient` and ensure that your application communicates efficiently and securely with web services. -### Example: Usage of HttpRequestMessage properties +### Example: Usage of `HttpRequestMessage` properties -Here's an example of how to use HttpClient and HttpRequestMessage together: +Here's an example of how to use `HttpClient` and `HttpRequestMessage` together: ```csharp var client = new HttpClient(); -var request = new HttpRequestMessage(HttpMethod.Post, "https://example.com"); // Method and RequestUri usage -var request = new HttpRequestMessage() // Alternative way to set RequestUri and Method +using var request = new HttpRequestMessage(HttpMethod.Post, "https://example.com"); // Method and RequestUri usage +using var request = new HttpRequestMessage() // Alternative way to set RequestUri and Method { RequestUri = new Uri("https://example.com"), Method = HttpMethod.Post @@ -215,7 +215,7 @@ using var response = await client.GetAsync(uri); var redirectedUri = response.RequestMessage.RequestUri; ``` -## Usage of SocketsHttpHandler and ConnectCallback +## Usage of `SocketsHttpHandler` and `ConnectCallback` The `ConnectCallback` property in `SocketsHttpHandler` allows developers to customize the process of establishing a TCP connection. This can be useful for scenarios where you need to control DNS resolution or apply specific socket options on the connection. By using `ConnectCallback`, you can intercept and modify the connection process before it is used by `HttpClient`. @@ -318,9 +318,9 @@ using var response = await client.GetAsync(uri); ### Example: Enable DNS round robin -DNS Round Robin is a technique used to distribute network traffic across multiple servers by rotating through a list of IP addresses associated with a single domain name. This helps in load balancing and improving the availability of services. When using HttpClient, you can implement DNS Round Robin by manually handling the DNS resolution and rotating through the IP addresses using the ConnectCallback property of SocketsHttpHandler. +DNS Round Robin is a technique used to distribute network traffic across multiple servers by rotating through a list of IP addresses associated with a single domain name. This helps in load balancing and improving the availability of services. When using `HttpClient`, you can implement DNS Round Robin by manually handling the DNS resolution and rotating through the IP addresses using the `ConnectCallback` property of `SocketsHttpHandler`. -To enable DNS Round Robin with HttpClient, you can use the ConnectCallback property to manually resolve the DNS entries and rotate through the IP addresses. Here's an example for `HttpWebRequest` and `HttpClient`: +To enable DNS Round Robin with `HttpClient`, you can use the `ConnectCallback` property to manually resolve the DNS entries and rotate through the IP addresses. Here's an example for `HttpWebRequest` and `HttpClient`: **Old code using `HttpWebRequest`**: @@ -343,11 +343,11 @@ For the implementation of `DnsRoundRobinConnector`, see [DnsRoundRobin.cs](https :::code source="../snippets/httpclient/Program.DnsRoundRobin.cs" id="DnsRoundRobinConnect"::: -### Example: Set SocketsHttpHandler properties +### Example: Set `SocketsHttpHandler` properties -SocketsHttpHandler is a powerful and flexible handler in .NET that provides advanced configuration options for managing HTTP connections. By setting various properties of SocketsHttpHandler, you can fine-tune the behavior of your HTTP client to meet specific requirements, such as performance optimization, security enhancements, and custom connection handling. +`SocketsHttpHandler` is a powerful and flexible handler in .NET that provides advanced configuration options for managing HTTP connections. By setting various properties of `SocketsHttpHandler`, you can fine-tune the behavior of your HTTP client to meet specific requirements, such as performance optimization, security enhancements, and custom connection handling. -Here's an example of how to configure SocketsHttpHandler with various properties and use it with HttpClient: +Here's an example of how to configure `SocketsHttpHandler` with various properties and use it with `HttpClient`: ```c# var cookieContainer = new CookieContainer(); @@ -374,11 +374,11 @@ using var response = await client.GetAsync(uri); This functionality is specific to certain platforms and is somewhat outdated. If you need a workaround, you can refer to [this section of the code](https://github.com/dotnet/runtime/blob/171f1a73a9f0fa77464995bcb893a59b9b98bc3d/src/libraries/System.Net.Requests/src/System/Net/HttpWebRequest.cs#L1678-L1684). -## Usage of Certificate and TLS-related properties in HttpClient +## Usage of Certificate and TLS-related properties in `HttpClient` When working with `HttpClient`, you may need to handle client certificates for various purposes, such as custom validation of server certificates or fetching the server certificate. `HttpClient` provides several properties and options to manage certificates effectively. -### Example: Check certificate revocation list with SocketsHttpHandler +### Example: Check certificate revocation list with `SocketsHttpHandler` The `CheckCertificateRevocationList` property in `SocketsHttpHandler.SslOptions` allows developers to enable or disable the check for certificate revocation lists (CRL) during SSL/TLS handshake. Enabling this property ensures that the client verifies whether the server's certificate has been revoked, enhancing the security of the connection. @@ -445,10 +445,10 @@ Mutual authentication, also known as two-way SSL or client certificate authentic To enable mutual authentication, follow these steps: - Load the client certificate. -- Configure the HttpClientHandler or SocketsHttpHandler to include the client certificate. +- Configure the `HttpClientHandler` or `SocketsHttpHandler` to include the client certificate. - Set up the server certificate validation callback if custom validation is needed. -Here's an example using SocketsHttpHandler: +Here's an example using `SocketsHttpHandler`: ```csharp var handler = new SocketsHttpHandler @@ -478,21 +478,21 @@ Headers play a crucial role in HTTP communication, providing essential metadata ### Set request headers -Request headers are used to provide additional information to the server about the request being made. Common use cases include specifying the content type, setting authentication tokens, and adding custom headers. You can set request headers using the `DefaultRequestHeaders` property of `HttpClient` or the Headers property of `HttpRequestMessage`. +Request headers are used to provide additional information to the server about the request being made. Common use cases include specifying the content type, setting authentication tokens, and adding custom headers. You can set request headers using the `DefaultRequestHeaders` property of `HttpClient` or the `Headers` property of `HttpRequestMessage`. #### Example: Set custom request headers -**Setting Default Custom Request Headers in HttpClient** +**Setting Default Custom Request Headers in `HttpClient`** ```csharp var client = new HttpClient(); client.DefaultRequestHeaders.Add("Custom-Header", "value"); ``` -**Setting Custom Request Headers in HttpRequestMessage** +**Setting Custom Request Headers in `HttpRequestMessage`** ```csharp -var request = new HttpRequestMessage(HttpMethod.Get, uri); +using var request = new HttpRequestMessage(HttpMethod.Get, uri); request.Headers.Add("Custom-Header", "value"); ``` @@ -503,7 +503,7 @@ For a comprehensive list of common properties available in [!WARNING] -> `HttpClient` does not have built-in logic to cache responses. There is no workaround other than implementing all the caching yourself. Simply setting the headers will not achieve caching. +> `HttpClient` doesn't have built-in logic to cache responses. There is no workaround other than implementing all the caching yourself. Simply setting the headers won't achieve caching. When migrating from `HttpWebRequest` to `HttpClient`, it's important to correctly handle cache-related headers such as `pragma` and `cache-control`. These headers control how responses are cached and retrieved, ensuring that your application behaves as expected in terms of performance and data freshness. @@ -585,7 +585,7 @@ For the implementation of `AddCacheControlHeaders`, see [AddCacheControlHeaders. ## Usage of buffering properties -When migrating from HttpWebRequest to `HttpClient`, it's important to understand the differences in how these two APIs handle buffering. +When migrating from `HttpWebRequest` to `HttpClient`, it's important to understand the differences in how these two APIs handle buffering. **Old code using `HttpWebRequest`**: @@ -601,16 +601,16 @@ request.AllowWriteStreamBuffering = false; // Default is `true`. In `HttpClient`, there are no direct equivalents to the `AllowWriteStreamBuffering` and `AllowReadStreamBuffering` properties. -HttpClient does not buffer request bodies on its own, instead delegating the responsibility to the `HttpContent` used. Contents like `StringContent` or `ByteArrayContent` are logically already buffered in memory, while using `StreamContent` will not incur any buffering by default. To force the content to be buffered, you may call `HttpContent.LoadIntoBufferAsync` before sending the request. Here's an example: +`HttpClient` doesn't buffer request bodies on its own, instead delegating the responsibility to the `HttpContent` used. Contents like `StringContent` or `ByteArrayContent` are logically already buffered in memory, while using `StreamContent` won't incur any buffering by default. To force the content to be buffered, you may call `HttpContent.LoadIntoBufferAsync` before sending the request. Here's an example: ```csharp HttpClient client = new HttpClient(); -HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, uri); +using HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, uri); request.Content = new StreamContent(yourStream); await request.Content.LoadIntoBufferAsync(); -HttpResponseMessage response = await client.SendAsync(request); +using HttpResponseMessage response = await client.SendAsync(request); ``` In `HttpClient` read buffering is enabled by default. To avoid it, you may specify the `HttpCompletionOption.ResponseHeadersRead` flag, or use the `GetStreamAsync` helper. From bffd44cb72b4abd5064e44bed1fe83880582e546 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Tue, 23 Sep 2025 14:22:01 -0700 Subject: [PATCH 6/6] Update GitHub Copilot app mod docs (#48683) * Updates * Redirect old install article * Add prereqs to the other appmod * Fix build errs * Clarify asp.net (core) * Update wording around uninstall * Feedback * Minor alter --- .openpublishing.redirection.azure.json | 8 + .openpublishing.redirection.core.json | 4 + .../migration/appmod/containerization.md | 10 +- docs/azure/migration/appmod/deploy.md | 10 +- docs/azure/migration/appmod/faq.md | 160 ------------------ docs/azure/migration/appmod/overview.md | 90 ---------- docs/azure/migration/appmod/quickstart.md | 12 +- docs/azure/toc.yml | 4 +- ...ithub-copilot-app-modernization-install.md | 71 -------- ...thub-copilot-app-modernization-overview.md | 39 ++--- .../how-to-upgrade-with-github-copilot.md | 22 +-- .../github-copilot-how-to-initiate.md | 17 ++ .../includes/github-copilot-suggestion.md | 7 + .../github-copilot-app-mod-prereqs.md | 30 ++++ 14 files changed, 92 insertions(+), 392 deletions(-) delete mode 100644 docs/azure/migration/appmod/faq.md delete mode 100644 docs/azure/migration/appmod/overview.md delete mode 100644 docs/core/porting/github-copilot-app-modernization-install.md create mode 100644 docs/core/porting/includes/github-copilot-how-to-initiate.md create mode 100644 docs/includes/github-copilot-app-mod-prereqs.md diff --git a/.openpublishing.redirection.azure.json b/.openpublishing.redirection.azure.json index d097c330c79c3..59f009f27949f 100644 --- a/.openpublishing.redirection.azure.json +++ b/.openpublishing.redirection.azure.json @@ -16,6 +16,14 @@ "source_path_from_root": "/docs/azure/dotnet-howto-migrate-vm.md", "redirect_url": "/dotnet/azure/migration/vm" }, + { + "source_path_from_root": "/docs/azure/migration/appmod/overview.md", + "redirect_url": "/dotnet/core/porting/github-copilot-app-modernization-overview?toc=/dotnet/azure/toc.json&bc=/dotnet/breadcrumb/toc.json" + }, + { + "source_path_from_root": "/docs/azure/migration/appmod/faq.md", + "redirect_url": "/dotnet/core/porting/github-copilot-app-modernization-faq?toc=/dotnet/azure/toc.json&bc=/dotnet/breadcrumb/toc.json" + }, { "source_path_from_root": "/docs/azure/dotnet-quickstart-vs.md", "redirect_url": "/visualstudio/deployment/quickstart-deploy-aspnet-web-app" diff --git a/.openpublishing.redirection.core.json b/.openpublishing.redirection.core.json index 7297db8b7c105..6533ed21ccc4f 100644 --- a/.openpublishing.redirection.core.json +++ b/.openpublishing.redirection.core.json @@ -926,6 +926,10 @@ "redirect_url": "/dotnet/core/deploying/index", "redirect_document_id": true }, + { + "source_path_from_root": "/docs/core/porting/github-copilot-app-modernization-install.md", + "redirect_url": "/dotnet/core/porting/github-copilot-app-modernization-overview" + }, { "source_path_from_root": "/docs/core/preview3/tools/csproj.md", "redirect_url": "/dotnet/core/project-sdk/msbuild-props", diff --git a/docs/azure/migration/appmod/containerization.md b/docs/azure/migration/appmod/containerization.md index e6dcefcc6a0b7..6ae086ad208d6 100644 --- a/docs/azure/migration/appmod/containerization.md +++ b/docs/azure/migration/appmod/containerization.md @@ -22,15 +22,7 @@ In this quickstart, you learn how to containerize your project using GitHub Copi Before you begin, make sure you have: -- Windows operating system -- [Visual Studio 2022 version 17.14.16 or newer](https://visualstudio.microsoft.com/downloads/) -- [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#change-workloads-or-individual-components) with these optional components enabled: - - GitHub Copilot - - GitHub Copilot app modernization for .NET -- GitHub account with Copilot access and a supported subscription plan: - - [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). - - Supported subscription plans: Copilot Pro, Copilot Pro+, Copilot Business, or Copilot Enterprise. - - If you change subscriptions, restart Visual Studio. +[!INCLUDE[github-copilot-app-mod-prereqs](../../../includes/github-copilot-app-mod-prereqs.md)] ## Containerize your project diff --git a/docs/azure/migration/appmod/deploy.md b/docs/azure/migration/appmod/deploy.md index 5ee2948f9a997..8095816a4b1e4 100644 --- a/docs/azure/migration/appmod/deploy.md +++ b/docs/azure/migration/appmod/deploy.md @@ -14,15 +14,7 @@ In this quickstart, you learn how to deploy your project to Azure with GitHub Co ## Prerequisites -- Windows operating system -- [Visual Studio 2022 version 17.14.16 or newer](https://visualstudio.microsoft.com/downloads/) -- [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#change-workloads-or-individual-components) with these optional components enabled: - - GitHub Copilot - - GitHub Copilot app modernization for .NET -- GitHub account with Copilot access and a supported subscription plan: - - [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). - - Supported subscription plans: Copilot Pro, Copilot Pro+, Copilot Business, or Copilot Enterprise. - - If you change subscriptions, restart Visual Studio. +[!INCLUDE[github-copilot-app-mod-prereqs](../../../includes/github-copilot-app-mod-prereqs.md)] ## Deploy your project diff --git a/docs/azure/migration/appmod/faq.md b/docs/azure/migration/appmod/faq.md deleted file mode 100644 index 3c6b5ef300864..0000000000000 --- a/docs/azure/migration/appmod/faq.md +++ /dev/null @@ -1,160 +0,0 @@ ---- -title: GitHub Copilot app modernization for .NET (Preview) FAQ -description: Discover answers to common questions about GitHub Copilot app modernization for .NET -ms.topic: concept-article -ms.custom: devx-track-dotnet -ms.date: 7/15/2025 -author: alexwolfmsft -ms.author: alexwolf ---- - -# Frequently Asked Questions for GitHub Copilot app modernization for .NET (Preview) - -This page answers common questions about [GitHub Copilot app modernization for .NET (Preview)](overview.md). - -## Which version of Visual Studio should I use? - -Upgrade to Visual Studio 2022 version 17.14.11 or later for the best experience with both GitHub Copilot and App Modernization for .NET (Preview). - -## Which model should I use in GitHub Copilot agent mode? - -Based on our benchmark, GitHub Copilot and App Modernization for .NET work best with Claude Sonnet 4.0 then Claude Sonnet 3.7. - -## What is the MCP Server, and why is there sometimes an initial delay when running a command? - -The GitHub Copilot app modernization for .NET (Preview) extension uses an MCP Server to provide Azure-related knowledge bases as tools. - -- **Automatic setup:** - On the first invocation of any App Modernization command, the extension checks for a configuration file at `%USERPROFILE%\.mcp.json`. If it's missing or the server isn't running, the extension writes the default settings and launches the MCP Server automatically. - -- **First-run delay:** - Starting and initializing the MCP Server can take anywhere from a few milliseconds up to about 20 seconds. - -- **Subsequent invocations:** - Once the MCP Server is running locally, you should not see that startup delay again. - -- **Using MCP tools in the VS Copilot Agent (outside the extension):** - You can also access the same MCP-based knowledge tools inside the built-in VS Copilot Agent. Just run **Configure MCP Server**, and the full suite of MCP tools appears under the Copilot agent's tools dropdown. - -## What should I do if configuring the MCP Server fails? - -If the MCP Server doesn't start correctly, try the following steps: - -1. Retry the **Configure MCP Server** command. -2. If it still fails, manually restart the MCP Server: - 1. Switch GitHub Copilot to **Agent** mode. - 2. Click the **Tools** icon in the pane. - 3. Expand the **appModernization** section by clicking the arrow icon next to it. - 4. Click **Restart** to relaunch the MCP Server. - -## Why is there an error in the "appModernization" group under Tools in GitHub Copilot Agent mode after uninstalling the extension, and how can I fix it? - -When the extension is installed, it adds a configuration entry to `%USERPROFILE%\.mcp.json` to register the `appModernization` tool with GitHub Copilot Agent in Visual Studio. This enables the `Tools → appModernization` group within Copilot Agent mode. -After the extension is uninstalled, this configuration remains. Since the associated command no longer exists, GitHub Copilot Agent mode displays a red error indicator next to the `appModernization` group. - -To resolve this: - -- **Edit `%USERPROFILE%\.mcp.json`** - - Open the file in a text editor and remove the `"appModernization"` entry from the `"servers"` section. - Save the file after removing this block. -- **Or delete the file entirely** - - If `.mcp.json` contains no other important configuration, you may simply delete the file. - -Once cleaned up, the error in the `Tools → appModernization` group will no longer appear. - -## How can I monitor assessment progress? - -While the assessment is running, you can monitor its progress by viewing the command-line output: - -1. In Visual Studio, go to **View** > **Output** to open the Output window. -2. In the Output window, find the **Show output from:** dropdown. -3. Select **AppModernizationExtension** from the dropdown list. -4. The command-line output from the assessment tool appears here, showing real-time progress. - -You can also access the Output window using the keyboard shortcut **Ctrl+Alt+O**. - -## What should I do if Visual Studio fails to install AppCAT? - -If you see an AppCAT installation failure in the command-line output when the extension tries to install it automatically, you can install AppCAT manually: - -1. Open a command prompt or PowerShell as Administrator. -2. Run the appropriate command based on your shell: - - **For Command Prompt:** - - ```cmd - dotnet tool install dotnet-appcat --tool-path "%LOCALAPPDATA%\Microsoft\VisualStudio\AppModernizationExtension\Tools" - ``` - - **For PowerShell:** - - ```powershell - dotnet tool install dotnet-appcat --tool-path "$env:LOCALAPPDATA\Microsoft\VisualStudio\AppModernizationExtension\Tools" - ``` - -3. After successful installation, run the assessment again. - -> [!IMPORTANT] -> Installing this tool may fail if you've configured additional NuGet feed sources. Use the `--ignore-failed-sources` parameter to treat those failures as warnings instead of errors. - -### What should I do if Visual Studio fails to upgrade AppCAT? - -If Visual Studio fails to automatically upgrade AppCAT when a new version is available, you can upgrade it manually: - -1. Open a command prompt or PowerShell as Administrator. -2. Run the appropriate command based on your shell: - - **For Command Prompt:** - - ```cmd - dotnet tool update dotnet-appcat --tool-path "%LOCALAPPDATA%\Microsoft\VisualStudio\AppModernizationExtension\Tools" - ``` - - **For PowerShell:** - - ```powershell - dotnet tool update dotnet-appcat --tool-path "$env:LOCALAPPDATA\Microsoft\VisualStudio\AppModernizationExtension\Tools" - ``` - -3. After successful upgrade, run the assessment again. - -## What should I do if I see "Command failed: No .NET SDKs were found" errors? - -This error occurs when AppCAT cannot find a compatible .NET SDK, even if you have other .NET SDKs installed. AppCAT requires the .NET 9.0 SDK to run properly. - -To fix this error: - -1. Download and install the .NET 9.0 SDK from . -2. Restart Visual Studio. -3. Run the assessment again. - -> [!NOTE] -> The GitHub Copilot app modernization for .NET extension can automatically help you install or upgrade to .NET 9. If you have an older version of the extension, update to the latest version for automatic installation assistance for the required .NET 9.0 SDK. - -## Does the tool store my source code? - -No. The tool uses GitHub Copilot in the same way you use it to modify code, and doesn't retain code snippets beyond the immediate session. Telemetry metrics are collected and analyzed to track feature usage and effectiveness. - -For more information, see the [Microsoft Privacy Statement](https://go.microsoft.com/fwlink/?LinkId=521839). - -## What are the intended uses of GitHub Copilot app modernization for .NET (Preview)? - -GitHub Copilot app modernization for .NET (Preview) is designed to help enterprises migrate their .NET applications to Azure. It assesses application code issues that need to be addressed for migration and provides code remediation patterns that can be applied with AI. - -## How was GitHub Copilot app modernization for .NET (Preview) evaluated? What metrics are used to measure performance? - -GitHub Copilot app modernization for .NET (Preview) was evaluated through extensive manual and automated testing. Additional evaluation was performed using custom datasets for offensive and malicious prompts (user questions) and responses. The tool is also continuously evaluated with user feedback. - -## What are the limitations of GitHub Copilot app modernization for .NET (Preview)? - -GitHub Copilot app modernization for .NET (Preview) can be used on application source code written in .NET Framework or .NET Core. Applications in other languages are not supported. - -## What operational factors and settings allow for effective and responsible use of GitHub Copilot app modernization for .NET (Preview)? - -You can choose the model to make code changes at the bottom of the GitHub Copilot chat box. Different models may produce different results and have varying token consumption. For more information, see [Manage Copilot usage and models](/visualstudio/ide/copilot-usage-and-models). - -## How do I provide feedback on GitHub Copilot app modernization for .NET (Preview)? - -We value your feedback—share [your thoughts here](https://aka.ms/AM4DFeedback) to help us continue improving the product. diff --git a/docs/azure/migration/appmod/overview.md b/docs/azure/migration/appmod/overview.md deleted file mode 100644 index aa358a626dd62..0000000000000 --- a/docs/azure/migration/appmod/overview.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Overview of GitHub Copilot app modernization for .NET (Preview) -description: Learn about essential concepts for GitHub Copilot app modernization for .NET -ms.topic: concept-article -ms.custom: devx-track-dotnet -ms.date: 7/15/2025 -author: alexwolfmsft -ms.author: alexwolf ---- - -# GitHub Copilot app modernization for .NET (Preview) overview - -[GitHub Copilot app modernization for .NET (Preview)](https://aka.ms/appmod-dotnet-marketplace) helps you migrate .NET applications to Azure quickly and confidently by guiding you through assessment, solution recommendations, code fixes, and validation - all in one tool. - -With this assistant, you can: - -- Assess your application's code, configuration, and dependencies. -- Plan and set up the right Azure resource -- Fix issues and apply best practices for cloud migration -- Validate that your app builds and tests successfully - -This process streamlines modernization and boosts developer productivity and confidence. App Modernization for .NET is an all-in-one migration assistant that uses AI to improve developer velocity, quality, and results. - -App Modernization for .NET is provided as a Visual Studio extension and relies on the following tools to be installed and configured for the full experience: - -- [A GitHub account with GitHub Copilot enabled](https://github.com/features/copilot) (Pro, Pro+, Business, or Enterprise plan required) -- [The GitHub Copilot extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) for Visual Studio (latest version recommended) -- [Azure Migrate application and code assessment for .NET](../appcat/install.md) for assessment features - -For a complete walkthrough of setting up and using GitHub Copilot app modernization for .NET, see [Quickstart: Assessing an application and applying code changes](quickstart.md). - -## Key concepts - -GitHub Copilot app modernization for .NET supports end-to-end migration to Azure, including assessment, planning, code remediation, build fixes, and unit test fixes. It uses GitHub Copilot AI capabilities to help you migrate and run your applications on Azure with confidence, accelerating the entire modernization lifecycle. - -The tool also relies on [Azure Migrate application and code assessment (AppCAT)](../appcat/app-code-assessment-toolkit.md) to analyze your code and identify modernization opportunities. You can use GitHub Copilot app modernization for .NET to get an overview of cloud readiness migration issues, including: - -- Best practice recommendations -- Suggestions for changing your application code - -When code changes are needed, the tool guides you through remediation using predefined tasks for common issues, such as: - -- Switching from password-based authentication to managed identities -- Moving from AWS S3 to Azure Blob Storage - -For more information, see [Predefined tasks](predefined-tasks.md). - -### Upgrading .NET projects - -Upgrading .NET apps is a common task that requires substantial time and resources. GitHub Copilot app modernization is an AI-based solution designed to assist with updating your .NET apps. For more information, see [GitHub Copilot app modernization](../../../core/porting/github-copilot-app-modernization-overview.md). - -## Common use cases - -App Modernization for .NET (Preview) supports the following scenarios: - -- **Assessment of modernization issue** - - Evaluates your application's readiness for Azure migration in Visual Studio, powered by [AppCAT for .NET](../appcat/install.md). - - ![Assessment](media/overview-assessment.png) - -- **Solution recommendations** - - Recommends target Azure services for your application's resource dependencies, tailored to each category of assessed issues. - - ![Solution](media/overview-solution.png) - -- **Code remediation for common issues** - - Accelerates code changes for [common modernization issues](predefined-tasks.md) by applying predefined tasks that represent expert best practices. - - ![Apply Task](media/overview-remediation.png) - -- **Automatic fixes for compilation errors:** - - Automatically discovers and fixes compilation errors introduced by code changes. - -## Feedback and privacy - -- **Feedback:** We value your feedback—share [your thoughts here](https://aka.ms/AM4DFeedback) to help us improve the product. -- **License:** This extension is licensed under the [GitHub Copilot Product Specific Terms](https://github.com/customer-terms/github-copilot-product-specific-terms). -- **Trademarks:** This project might contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos is subject to those third parties' policies. -- **Privacy:** App Modernization for .NET (Preview) uses GitHub Copilot in the same way you use it to modify code, and doesn't retain code snippets beyond the immediate session. Telemetry metrics are collected and analyzed to track feature usage and effectiveness. Review the [Microsoft Privacy Statement](https://go.microsoft.com/fwlink/?LinkId=521839) for more information. -- **Transparency:** App Modernization for .NET (Preview) uses GitHub Copilot to make code changes, and AI might sometimes make mistakes. Carefully review and test any code changes made by the tool before using them in your production environment. - -## Next Steps - -- [Quickstart: Assessing an application and applying code changes](quickstart.md) -- [Common modernization issues with predefined tasks](predefined-tasks.md) -- [Frequently Asked Questions](faq.md) diff --git a/docs/azure/migration/appmod/quickstart.md b/docs/azure/migration/appmod/quickstart.md index fae8a35d304ba..1f8707728439d 100644 --- a/docs/azure/migration/appmod/quickstart.md +++ b/docs/azure/migration/appmod/quickstart.md @@ -19,15 +19,7 @@ In this quickstart, you assess and migrate a .NET project by using GitHub Copilo ## Prerequisites -- Windows operating system -- [Visual Studio 2022 version 17.14.16 or newer](https://visualstudio.microsoft.com/downloads/) -- [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#change-workloads-or-individual-components) with these optional components enabled: - - GitHub Copilot - - GitHub Copilot app modernization for .NET -- GitHub account with Copilot access and a supported subscription plan: - - [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). - - Supported subscription plans: Copilot Pro, Copilot Pro+, Copilot Business, or Copilot Enterprise. - - If you change subscriptions, restart Visual Studio. +[!INCLUDE[github-copilot-app-mod-prereqs](../../../includes/github-copilot-app-mod-prereqs.md)] ## Assess app readiness @@ -116,4 +108,4 @@ You can choose one of the predefined options and send it in the chat: ## Next Steps - [Predefined Tasks](predefined-tasks.md) -- [Frequently Asked Questions](faq.md) +- [Frequently Asked Questions](../../../core/porting/github-copilot-app-modernization-faq.yml) diff --git a/docs/azure/toc.yml b/docs/azure/toc.yml index cbd97e033c01d..b92abe92f9705 100644 --- a/docs/azure/toc.yml +++ b/docs/azure/toc.yml @@ -27,9 +27,9 @@ items: - name: GitHub Copilot app modernization for .NET items: - name: Overview - href: ../core/porting/github-copilot-app-modernization-overview.md + href: ../core/porting/github-copilot-app-modernization-overview.md?toc=/dotnet/azure/toc.json&bc=/dotnet/breadcrumb/toc.json - name: FAQ - href: ../core/porting/github-copilot-app-modernization-faq.yml + href: ../core/porting/github-copilot-app-modernization-faq.yml?toc=/dotnet/azure/toc.json&bc=/dotnet/breadcrumb/toc.json - name: Predefined Tasks href: ./migration/appmod/predefined-tasks.md - name: Quickstart - Assess and migrate a .NET project diff --git a/docs/core/porting/github-copilot-app-modernization-install.md b/docs/core/porting/github-copilot-app-modernization-install.md deleted file mode 100644 index e919c6e8633c3..0000000000000 --- a/docs/core/porting/github-copilot-app-modernization-install.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Install GitHub Copilot app modernization -description: "Learn how to install the GitHub Copilot app modernization Visual Studio extension. App modernization assists you when upgrading projects to the latest dependencies or when upgrading to a new version of .NET" -titleSuffix: "" -author: adegeo -ms.author: adegeo -ms.topic: install-set-up-deploy -ms.date: 09/15/2025 - -#customer intent: As a developer, I want to install GitHub Copilot App Modernization so that I can upgrade my projects. - ---- - -# Install GitHub Copilot app modernization - -This article guides you through installing the GitHub Copilot app modernization extension in Visual Studio. - -> [!IMPORTANT] -> The GitHub Copilot Modernization agent is included in Visual Studio, starting with Visual Studio 2022 17.14.16 and Visual Studio 2026. - -## Prerequisites - -- Windows operating system -- [Visual Studio 2022 version 17.14.15 or earlier](https://visualstudio.microsoft.com/downloads/) -- [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#change-workloads-or-individual-components) - -While not required to _install_ the extension, to use the extension you must [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). - -Supported GitHub Copilot subscription plans are: - -- Copilot Pro -- Copilot Pro+ -- Copilot Business -- Copilot Enterprise - -(If you change subscriptions, you must restart Visual Studio.) - -## Visual Studio extension - -The following steps install the Visual Studio extension. - -> [!TIP] -> As an alternative to using the **Manage Extensions** feature of Visual Studio, you can download and run the extensions installer from the [Visual Studio Marketplace](https://aka.ms/ghcp-appmod/dotnet-upgrade-vsix). - -01. Open Visual Studio. - - If the **Open Recent \ Get Started** window opens, select the **Continue without code** link. - -01. Select the **Extensions** > **Manage Extensions** menu to open **Extension Manager**. -01. Select the **Browse** tab. -01. Enter `GitHub Copilot app modernization` into the search box. -01. Select **GitHub Copilot app modernization**, and then select **Install**. - - :::image type="content" source="media/github-copilot-app-modernization-install/visual-studio-manage-extensions.png" alt-text="The manage extensions window in Visual Studio, showing GitHub Copilot app modernization."::: - -01. Once the extension finishes downloading, close Visual Studio to automatically start the installation. - - :::image type="content" source="media/github-copilot-app-modernization-install/install-prompt.png" alt-text="A prompt to install the GitHub Copilot App Modernization extension."::: - -01. Select **Modify** and follow the instructions to install the extension. - -## Validation - -There are two ways to determine if GitHub Copilot App Modernization is installed as a Visual Studio extension: - -- The quickest way is to right-click on any .NET or .NET Framework project in **Solution Explorer** and check for an **Upgrade with GitHub Copilot** menu item. -- Another way is to select the **Extensions** > **Manage Extensions** menu to open the **Extension Manager** window. Then, select the **Installed** tab and find it in the list of installed extensions. - -## Related content - -- [What is GitHub Copilot app modernization?](github-copilot-app-modernization-overview.md) diff --git a/docs/core/porting/github-copilot-app-modernization-overview.md b/docs/core/porting/github-copilot-app-modernization-overview.md index 53082daab9250..5b0c55c67f2cd 100644 --- a/docs/core/porting/github-copilot-app-modernization-overview.md +++ b/docs/core/porting/github-copilot-app-modernization-overview.md @@ -5,13 +5,13 @@ titleSuffix: "" author: adegeo ms.author: adegeo ms.topic: overview -ms.date: 09/15/2025 +ms.date: 09/23/2025 -#customer intent: As a developer, I want to upgrade my project or migrate the project to Azure so that I can take advantage of the latest features. +#customer intent: As a developer, I want to learn about what the GitHub Copilot app modernziation is, so that I understand its capabilities and how I can take advantage of it. --- -# GitHub Copilot app modernization +# What is GitHub Copilot app modernization? GitHub Copilot app modernization is a GitHub Copilot agent that helps upgrade projects to newer versions of .NET and migrate .NET applications to Azure quickly and confidently by guiding you through assessment, solution recommendations, code fixes, and validation - all within Visual Studio. @@ -27,39 +27,36 @@ With this assistant, you can: - Fix issues and apply best practices for cloud migration. - Validate that your app builds and tests successfully. +> [!IMPORTANT] +> Starting with Visual Studio 2022 17.14.16, the GitHub Copilot app modernization agent is included with Visual Studio. If you're using an older version of Visual Studio 2022, upgrade to the latest release. +> +> If you installed any of the following extensions published by Microsoft, uninstall them before using the version now included in Visual Studio: +> +> - .NET Upgrade Assistant +> - GitHub Copilot App Modernization – Upgrade for .NET +> - Azure Migrate Application and Code Assessment for .NET + ## Provide feedback Feedback is important to Microsoft and the efficiency of this agent. Use the [Suggest a feature](/visualstudio/ide/suggest-a-feature) and [Report a problem](/visualstudio/ide/report-a-problem) features of Visual Studio to provide feedback. ## Prerequisites -- Windows Operating System -- [Visual Studio 2022 version 17.14.16 or newer](https://visualstudio.microsoft.com/downloads/). (To be released) -- [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#change-workloads-or-individual-components) with the following optional components enabled: - - - GitHub Copilot - - GitHub Copilot app modernization for .NET - -- Copilot license and supported subscription plan: - - [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). +The following items are required before you can use GitHub Copilot app modernization: - Supported subscription plans: +[!INCLUDE[github-copilot-app-mod-prereqs](../../includes/github-copilot-app-mod-prereqs.md)] - - Copilot Pro - - Copilot Pro+ - - Copilot Business - - Copilot Enterprise +## How to start an upgrade or migration - (If you change subscriptions, you must restart Visual Studio.) +To start an upgrade or migration, interact with GitHub Copilot, following these steps: -- Code must be written in C#. +[!INCLUDE[github-copilot-how-to-initiate](./includes/github-copilot-how-to-initiate.md)] ## Upgrade .NET projects The modernization agent supports upgrading projects coded in C#. The following types of projects are supported: -- ASP.NET and related technologies such as MVC, Razor Pages, Web API +- ASP.NET and ASP.NET Core (including related technologies such as MVC, Razor Pages, and Web API) - Blazor - Azure Functions - Windows Presentation Foundation diff --git a/docs/core/porting/how-to-upgrade-with-github-copilot.md b/docs/core/porting/how-to-upgrade-with-github-copilot.md index bf9d77776124e..6689a5a1f8712 100644 --- a/docs/core/porting/how-to-upgrade-with-github-copilot.md +++ b/docs/core/porting/how-to-upgrade-with-github-copilot.md @@ -21,31 +21,13 @@ The modernization agent analyzes your projects and dependencies, creates an upgr Before you begin, ensure you have the following requirements: -- Windows Operating System -- [Visual Studio 2022 version 17.14.16 or newer](https://visualstudio.microsoft.com/downloads/) (To be released) -- [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#change-workloads-or-individual-components) with the following optional components enabled: - - GitHub Copilot - - GitHub Copilot app modernization for .NET -- GitHub account with Copilot access and supported subscription plan: - - [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) - - Supported subscription plans: Copilot Pro, Copilot Pro+, Copilot Business, or Copilot Enterprise - - If you change subscriptions, you must restart Visual Studio -- A .NET project written in C# that you want to upgrade +[!INCLUDE[github-copilot-app-mod-prereqs](../../includes/github-copilot-app-mod-prereqs.md)] ## Start the upgrade process The first step to upgrading is generating a plan by interacting with GitHub Copilot. Follow these steps to initiate the upgrade: -1. Open your .NET project or solution in Visual Studio. -1. Access the GitHub Copilot app modernization agent using one of these methods: - - Right-click on the solution or project in **Solution Explorer** and select **Modernize**. - - —or— - - Open the **GitHub Copilot Chat** window and type `@modernize` followed by your upgrade request. - -1. Tell the `@modernize` agent what you want to upgrade. +[!INCLUDE[github-copilot-how-to-initiate](./includes/github-copilot-how-to-initiate.md)] ## Generate an upgrade plan diff --git a/docs/core/porting/includes/github-copilot-how-to-initiate.md b/docs/core/porting/includes/github-copilot-how-to-initiate.md new file mode 100644 index 0000000000000..128a593a792ea --- /dev/null +++ b/docs/core/porting/includes/github-copilot-how-to-initiate.md @@ -0,0 +1,17 @@ +--- +author: adegeo +ms.author: adegeo +ms.date: 09/23/2025 +ms.topic: include +--- + +1. Open your .NET project or solution in Visual Studio. +1. Access the GitHub Copilot app modernization agent using one of these methods: + + Right-click on the solution or project in **Solution Explorer** and select **Modernize**. + + —or— + + Open the **GitHub Copilot Chat** window and type `@modernize` followed by your upgrade or migration request. + +1. Tell the `@modernize` agent what you want to upgrade or migrate. diff --git a/docs/core/porting/includes/github-copilot-suggestion.md b/docs/core/porting/includes/github-copilot-suggestion.md index 84484c3bbec7c..80440322bdcbb 100644 --- a/docs/core/porting/includes/github-copilot-suggestion.md +++ b/docs/core/porting/includes/github-copilot-suggestion.md @@ -1,2 +1,9 @@ +--- +author: adegeo +ms.author: adegeo +ms.date: 09/23/2025 +ms.topic: include +--- + > [!IMPORTANT] > Try the [GitHub Copilot app modernization chat agent](../github-copilot-app-modernization-overview.md). This agent analyzes your projects and dependencies, produces a step-by-step migration plan with targeted recommendations and automated code fixes, and commits each change so you can validate or roll back. It automates common porting tasks—updating project files, replacing deprecated APIs, and resolving build issues—so you can modernize faster with less manual effort. For more information, see [What is GitHub Copilot app modernization](../github-copilot-app-modernization-overview.md). diff --git a/docs/includes/github-copilot-app-mod-prereqs.md b/docs/includes/github-copilot-app-mod-prereqs.md new file mode 100644 index 0000000000000..c8d3832c08cc4 --- /dev/null +++ b/docs/includes/github-copilot-app-mod-prereqs.md @@ -0,0 +1,30 @@ +--- +author: adegeo +ms.author: adegeo +ms.date: 09/23/2025 +ms.topic: include +# Shared by Azure.NET app mod and .NET app mod +--- + +- Windows Operating System +- [Visual Studio 2022 version 17.14.16 or newer](https://visualstudio.microsoft.com/downloads/). +- [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#change-workloads-or-individual-components) with the following optional components enabled: + + - GitHub Copilot + - GitHub Copilot app modernization for .NET + +- Copilot license and supported subscription plan: + + [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). + + Supported subscription plans: + + - Copilot Pro + - Copilot Pro+ + - Copilot Business + - Copilot Enterprise + + > [!IMPORTANT] + > If you change subscriptions, you must restart Visual Studio. + +- Code must be written in C#.