diff --git a/docs/ai/get-started-app-chat-scaling-with-azure-container-apps.md b/docs/ai/get-started-app-chat-scaling-with-azure-container-apps.md index 7cc51cf6a20b2..65470bc556213 100644 --- a/docs/ai/get-started-app-chat-scaling-with-azure-container-apps.md +++ b/docs/ai/get-started-app-chat-scaling-with-azure-container-apps.md @@ -14,11 +14,8 @@ ms.custom: devx-track-dotnet, devx-track-dotnet-ai ## Prerequisites * Azure subscription. [Create one for free](https://azure.microsoft.com/free/ai-services?azure-portal=true). -* Access granted to Azure OpenAI in the desired Azure subscription. - Currently, access to this service is granted only by application. You should [apply for access](https://aka.ms/oai/access) to Azure OpenAI. - -* [Dev containers](https://containers.dev/) are available for both samples, with all dependencies required to complete this article. You can run the dev containers in GitHub Codespaces (in a browser) or locally using Visual Studio Code. +[Dev containers](https://containers.dev/) are available for both samples, with all dependencies required to complete this article. You can run the dev containers in GitHub Codespaces (in a browser) or locally using Visual Studio Code. #### [Codespaces (recommended)](#tab/github-codespaces) diff --git a/docs/ai/get-started-app-chat-template.md b/docs/ai/get-started-app-chat-template.md index 3a5b0007e2019..512eda46efd34 100644 --- a/docs/ai/get-started-app-chat-template.md +++ b/docs/ai/get-started-app-chat-template.md @@ -58,16 +58,12 @@ To follow along with this article, you need the following prerequisites: * An Azure subscription - [Create one for free](https://azure.microsoft.com/free/ai-services?azure-portal=true) * Azure account permissions - Your Azure account must have Microsoft.Authorization/roleAssignments/write permissions, such as [User Access Administrator](/azure/role-based-access-control/built-in-roles#user-access-administrator) or [Owner](/azure/role-based-access-control/built-in-roles#owner). -* Access granted to Azure OpenAI in the desired Azure subscription. - Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at [https://aka.ms/oai/access](https://aka.ms/oai/access). Open an issue on this repo to contact us if you have a problem. * GitHub account #### [Visual Studio Code](#tab/visual-studio-code) * An Azure subscription - [Create one for free](https://azure.microsoft.com/free/ai-services?azure-portal=true) * Azure account permissions - Your Azure account must have Microsoft.Authorization/roleAssignments/write permissions, such as [User Access Administrator](/azure/role-based-access-control/built-in-roles#user-access-administrator) or [Owner](/azure/role-based-access-control/built-in-roles#owner). -* Access granted to Azure OpenAI in the desired Azure subscription. - Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at [https://aka.ms/oai/access](https://aka.ms/oai/access). Open an issue on this repo to contact us if you have a problem. * [Azure Developer CLI](/azure/developer/azure-developer-cli) * [Docker Desktop](https://www.docker.com/products/docker-desktop/) - Start Docker Desktop if it's not already running * [Visual Studio Code](https://code.visualstudio.com/) diff --git a/docs/ai/quickstarts/build-chat-app.md b/docs/ai/quickstarts/build-chat-app.md index 572a399e990e5..0a76a24dbc317 100644 --- a/docs/ai/quickstarts/build-chat-app.md +++ b/docs/ai/quickstarts/build-chat-app.md @@ -5,7 +5,6 @@ ms.date: 04/09/2025 ms.topic: quickstart ms.custom: devx-track-dotnet, devx-track-dotnet-ai author: fboucher -ms.author: frbouche zone_pivot_groups: openai-library # CustomerIntent: As a .NET developer new to AI, I want deploy and use sample code to interact to learn from the sample code. --- @@ -91,8 +90,8 @@ Complete the following steps to create a .NET console app to connect to an AI mo ```bash dotnet user-secrets init - dotnet user-secrets set OpenAIKey - dotnet user-secrets set ModelName + dotnet user-secrets set OpenAIKey + dotnet user-secrets set ModelName ``` :::zone-end diff --git a/docs/ai/quickstarts/build-vector-search-app.md b/docs/ai/quickstarts/build-vector-search-app.md index 39c9823f066f4..3ce8d93a2dd39 100644 --- a/docs/ai/quickstarts/build-vector-search-app.md +++ b/docs/ai/quickstarts/build-vector-search-app.md @@ -5,7 +5,6 @@ ms.date: 12/06/2024 ms.topic: quickstart ms.custom: devx-track-dotnet, devx-track-dotnet-ai author: fboucher -ms.author: frbouche zone_pivot_groups: openai-library # CustomerIntent: As a .NET developer new to AI, I want deploy and use sample code to interact to learn from the sample code. --- @@ -132,8 +131,8 @@ Complete the following steps to create a .NET console app that can: ```bash dotnet user-secrets init - dotnet user-secrets set OpenAIKey - dotnet user-secrets set ModelName + dotnet user-secrets set OpenAIKey + dotnet user-secrets set ModelName ``` > [!NOTE] diff --git a/docs/ai/quickstarts/generate-images.md b/docs/ai/quickstarts/generate-images.md index 14dc00733ea6e..9e235f0a8fb78 100644 --- a/docs/ai/quickstarts/generate-images.md +++ b/docs/ai/quickstarts/generate-images.md @@ -5,7 +5,6 @@ ms.date: 04/09/2025 ms.topic: quickstart ms.custom: devx-track-dotnet, devx-track-dotnet-ai author: fboucher -ms.author: frbouche zone_pivot_groups: openai-library # CustomerIntent: As a .NET developer new to OpenAI, I want deploy and use sample code to interact to learn from the sample code to generate images. --- @@ -88,8 +87,8 @@ Complete the following steps to create a .NET console app to connect to an AI mo ```bash dotnet user-secrets init - dotnet user-secrets set OpenAIKey - dotnet user-secrets set ModelName + dotnet user-secrets set OpenAIKey + dotnet user-secrets set ModelName ``` :::zone-end diff --git a/docs/ai/quickstarts/includes/ai-templates-azure-openai.md b/docs/ai/quickstarts/includes/ai-templates-azure-openai.md index edd173e3ffd4e..f2ca54e35675f 100644 --- a/docs/ai/quickstarts/includes/ai-templates-azure-openai.md +++ b/docs/ai/quickstarts/includes/ai-templates-azure-openai.md @@ -114,7 +114,7 @@ The **AI Chat Web App** app is almost ready to go as soon as it's created. Howev # [.NET CLI](#tab/configure-dotnet-cli) ```dotnetcli -dotnet user-secrets set AzureOpenAi:Endpoint +dotnet user-secrets set AzureOpenAi:Endpoint ``` --- diff --git a/docs/ai/quickstarts/includes/ai-templates-openai.md b/docs/ai/quickstarts/includes/ai-templates-openai.md index c8ba8957502ad..5e0baac0473c4 100644 --- a/docs/ai/quickstarts/includes/ai-templates-openai.md +++ b/docs/ai/quickstarts/includes/ai-templates-openai.md @@ -82,14 +82,14 @@ The **AI Chat Web App** app is almost ready to go as soon as it's created. Howev ```json { - "OpenAi:Key": "" + "OpenAi:Key": "" } ``` # [.NET CLI](#tab/configure-dotnet-cli) ```dotnetcli -dotnet user-secrets set OpenAi:Key +dotnet user-secrets set OpenAi:Key ``` --- diff --git a/docs/ai/quickstarts/includes/create-ai-service.md b/docs/ai/quickstarts/includes/create-ai-service.md index f80d2af925333..d000ddb2f3c88 100644 --- a/docs/ai/quickstarts/includes/create-ai-service.md +++ b/docs/ai/quickstarts/includes/create-ai-service.md @@ -8,6 +8,6 @@ ```bash dotnet user-secrets init - dotnet user-secrets set AZURE_OPENAI_ENDPOINT - dotnet user-secrets set AZURE_OPENAI_GPT_NAME + dotnet user-secrets set AZURE_OPENAI_ENDPOINT + dotnet user-secrets set AZURE_OPENAI_GPT_NAME ``` diff --git a/docs/ai/quickstarts/includes/prerequisites-azure-openai.md b/docs/ai/quickstarts/includes/prerequisites-azure-openai.md index fa59129aa182b..a7f156cc89eff 100644 --- a/docs/ai/quickstarts/includes/prerequisites-azure-openai.md +++ b/docs/ai/quickstarts/includes/prerequisites-azure-openai.md @@ -1,7 +1,6 @@ --- author: fboucher -ms.author: frbouche -ms.date: 05/22/2024 +ms.date: 05/12/2025 ms.topic: include --- @@ -9,5 +8,4 @@ ms.topic: include - .NET 8.0 SDK or higher - [Install the .NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0). - An Azure subscription - [Create one for free](https://azure.microsoft.com/free). -- Access to [Azure OpenAI service](/azure/ai-services/openai/overview#how-do-i-get-access-to-azure-openai). - Azure Developer CLI (optional) - [Install or update the Azure Developer CLI](/azure/developer/azure-developer-cli/install-azd). diff --git a/docs/ai/quickstarts/includes/prerequisites-openai.md b/docs/ai/quickstarts/includes/prerequisites-openai.md index d4222270ce398..3d3c3d99ced40 100644 --- a/docs/ai/quickstarts/includes/prerequisites-openai.md +++ b/docs/ai/quickstarts/includes/prerequisites-openai.md @@ -1,6 +1,5 @@ --- author: jmatthiesen -ms.author: jomatthi ms.date: 07/03/2024 ms.topic: include --- diff --git a/docs/ai/quickstarts/prompt-model.md b/docs/ai/quickstarts/prompt-model.md index ba72b52831b58..f0bb4668a5574 100644 --- a/docs/ai/quickstarts/prompt-model.md +++ b/docs/ai/quickstarts/prompt-model.md @@ -5,7 +5,6 @@ ms.date: 05/02/2025 ms.topic: quickstart ms.custom: devx-track-dotnet, devx-track-dotnet-ai author: fboucher -ms.author: frbouche zone_pivot_groups: openai-library # CustomerIntent: As a .NET developer new to OpenAI, I want deploy and use sample code to interact to learn from the sample code to summarize text. --- @@ -87,8 +86,8 @@ Complete the following steps to create a .NET console app to connect to an AI mo ```bash dotnet user-secrets init - dotnet user-secrets set OpenAIKey - dotnet user-secrets set ModelName + dotnet user-secrets set OpenAIKey + dotnet user-secrets set ModelName ``` :::zone-end diff --git a/docs/ai/quickstarts/structured-output.md b/docs/ai/quickstarts/structured-output.md index b43f79695c3dc..f1c5727200748 100644 --- a/docs/ai/quickstarts/structured-output.md +++ b/docs/ai/quickstarts/structured-output.md @@ -44,9 +44,9 @@ Complete the following steps to create a console app that connects to the `gpt-4 ```bash dotnet user-secrets init - dotnet user-secrets set AZURE_OPENAI_ENDPOINT + dotnet user-secrets set AZURE_OPENAI_ENDPOINT dotnet user-secrets set AZURE_OPENAI_GPT_NAME gpt-4o - dotnet user-secrets set AZURE_TENANT_ID + dotnet user-secrets set AZURE_TENANT_ID ``` > [!NOTE] diff --git a/docs/ai/quickstarts/use-function-calling.md b/docs/ai/quickstarts/use-function-calling.md index ae976624c97d7..8b6ad629a64ba 100644 --- a/docs/ai/quickstarts/use-function-calling.md +++ b/docs/ai/quickstarts/use-function-calling.md @@ -5,7 +5,6 @@ ms.date: 03/13/2025 ms.topic: quickstart ms.custom: devx-track-dotnet, devx-track-dotnet-ai author: fboucher -ms.author: frbouche zone_pivot_groups: openai-library # CustomerIntent: As a .NET developer new to OpenAI, I want deploy and use sample code to interact to learn from the sample code how to extend the model using Tools. --- @@ -92,8 +91,8 @@ Complete the following steps to create a .NET console app to connect to an AI mo ```bash dotnet user-secrets init - dotnet user-secrets set OpenAIKey - dotnet user-secrets set ModelName + dotnet user-secrets set OpenAIKey + dotnet user-secrets set ModelName ``` :::zone-end diff --git a/docs/ai/tutorials/tutorial-ai-vector-search.md b/docs/ai/tutorials/tutorial-ai-vector-search.md index 4ab766f0bd46b..88add9865c4c8 100644 --- a/docs/ai/tutorials/tutorial-ai-vector-search.md +++ b/docs/ai/tutorials/tutorial-ai-vector-search.md @@ -46,10 +46,10 @@ The Cosmos Recipe Guide app allows you to perform vector and AI driven searches ```json "OpenAIEndpoint": "https://.openai.azure.com/", - "OpenAIKey": "", - "OpenAIEmbeddingDeployment": "", - "OpenAIcompletionsDeployment": "", - "MongoVcoreConnection": "" + "OpenAIKey": "", + "OpenAIEmbeddingDeployment": "", + "OpenAIcompletionsDeployment": "", + "MongoVcoreConnection": "" ``` 1. Launch the app by pressing the **Start** button at the top of Visual Studio. diff --git a/docs/core/compatibility/core-libraries/8.0/complex-format.md b/docs/core/compatibility/core-libraries/8.0/complex-format.md index 88bfbe2a83905..d6f471d87673c 100644 --- a/docs/core/compatibility/core-libraries/8.0/complex-format.md +++ b/docs/core/compatibility/core-libraries/8.0/complex-format.md @@ -36,3 +36,7 @@ If you need the previous format, you can use a custom string formatting mechanis ## Affected APIs - + +## See also + +- [Format a complex number](../../../../fundamentals/runtime-libraries/system-numerics-complex.md#format-a-complex-number) diff --git a/docs/core/diagnostics/dotnet-trace.md b/docs/core/diagnostics/dotnet-trace.md index e721f3e022a8f..5241946e518a9 100644 --- a/docs/core/diagnostics/dotnet-trace.md +++ b/docs/core/diagnostics/dotnet-trace.md @@ -150,6 +150,7 @@ dotnet-trace collect [--buffersize ] [--clreventlevel ] [-- | `compilationdiagnostic` | `0x2000000000` | | `methoddiagnostic` | `0x4000000000` | | `typediagnostic` | `0x8000000000` | + | `waithandle` | `0x40000000000` | You can read about the CLR provider more in detail on the [.NET runtime provider reference documentation](../../fundamentals/diagnostics/runtime-events.md). diff --git a/docs/core/diagnostics/eventpipe.md b/docs/core/diagnostics/eventpipe.md index f758633d2a305..1a05f379a4696 100644 --- a/docs/core/diagnostics/eventpipe.md +++ b/docs/core/diagnostics/eventpipe.md @@ -19,7 +19,7 @@ EventPipe aggregates events emitted by runtime components - for example, the Jus The events are then serialized in the `.nettrace` file format and can be written directly to a file or streamed through a [diagnostic port](./diagnostic-port.md) for out-of-process consumption. -To learn more about the EventPipe serialization format, refer to the [EventPipe format documentation](https://github.com/microsoft/perfview/blob/main/src/TraceEvent/EventPipe/EventPipeFormat.md). +To learn more about the NetTrace format, see the [NetTrace format documentation](https://github.com/microsoft/perfview/blob/main/src/TraceEvent/EventPipe/NetTraceFormat.md). ## EventPipe vs. ETW/perf_events diff --git a/docs/core/porting/github-copilot-app-modernization-faq.yml b/docs/core/porting/github-copilot-app-modernization-faq.yml new file mode 100644 index 0000000000000..c3ad4a80de75f --- /dev/null +++ b/docs/core/porting/github-copilot-app-modernization-faq.yml @@ -0,0 +1,69 @@ +### 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." + titleSuffix: "" + author: adegeo + ms.author: adegeo + ms.topic: faq + ms.date: 05/16/2025 + +title: GitHub Copilot app modernization - upgrade for .NET FAQ +summary: | + GitHub Copilot app modernization - upgrade for .NET is an interactive GitHub Copilot extension that adds powerful upgrade capabilities to Visual Studio. This article answers frequently asked questions. For more information about the tool, see [What is GitHub Copilot app modernization - upgrade for .NET?](github-copilot-app-modernization-overview.md). + +sections: + - name: Scenarios + questions: + - question: What can the tool do? + answer: | + Currently, app modernization - upgrade for .NET helps you upgrade your .NET projects to newer versions of .NET. The tool is an extension for Visual Studio that performs the following steps in a GitHub Copilot chat session: + + - Analyze your projects and proposes an upgrade plan. + - According to the plan, runs a series of tasks to upgrade your projects. + - Operates in a working branch under a local Git repository. + - Automatically fix issues during the code transformation. + - Report progress and allow access to code changes & logs. + - Learns from the interactive experience with you (within the context of the session) to improve subsequent transformations. + + - question: What can the tool upgrade? + answer: | + App modernization - upgrade for .NET currently focuses on migrating your projects from one version of .NET to another. For example, upgrading from .NET Core 3.1 or .NET 6, to .NET 9. It also upgrades dependencies and fixes errors in the code post-migration. + + Besides upgrading the target framework, the tool can work with the following types of projects: + + - Azure Functions. + - Console apps and class libraries. + - Web technologies such as: + - MVC + - Blazor + - Razor Pages + - Web API + - Desktop technologies such as Windows Forms and Windows Presentation Foundation. + - Test projects such as MSTest and NUnit. + + - question: What limitations are there? + answer: | + - It doesn't support .NET Framework projects. (First upgrade the project to .NET with the [Upgrade Assistant tool](upgrade-assistant-overview.md)) + - Only Git repositories are supported. + - There's no guarantee that the upgrade 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. + + - question: What data is collected? + answer: | + The tool only collects telemetry information about project types, intent to upgrade, and upgrade duration. The data is 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). + + - question: Can I disable telemetry? + answer: | + Yes, you can disable telemetry through Visual Studio itself. In Visual Studio, select **Help** > **Privacy** > **Privacy Settings** > **"No, I would not like to participate."** + + - question: Can I train the model based on my code base? + answer: | + No. Unlike traditional AI tools where you might enter freeform prompts, the tool operates in a more structured way. The AI is embedded within the build-and-fix process, meaning, the prompts it uses are predefined and tied to the upgrade plan. So it's not something you can train on your codebase, and it's not something you can manually steer with custom instructions, beyond the changes you can make to the plan markdown file. + + However, the tool does have some adaptability within a session. If you manually adjust a fix, it learns from that interaction in the short term and applies similar corrections if it encounters the same issue again. Think of it as refining its approach within the scope of that upgrade. We never store a user's codebase and never use your code for training the model. Once an upgrade is complete, session data is deleted and not stored. + +additionalContent: | + ## Related content + + To learn more, see [What is GitHub Copilot app modernization - upgrade for .NET?](github-copilot-app-modernization-overview.md). \ No newline at end of file diff --git a/docs/core/porting/github-copilot-app-modernization-install.md b/docs/core/porting/github-copilot-app-modernization-install.md new file mode 100644 index 0000000000000..d36ff71a60ddd --- /dev/null +++ b/docs/core/porting/github-copilot-app-modernization-install.md @@ -0,0 +1,58 @@ +--- +title: Install GitHub Copilot app modernization - upgrade for .NET +description: "Learn how to install the GitHub Copilot app modernization - upgrade for .NET 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: 05/16/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 - upgrade for .NET + +This article guides you through installing GitHub Copilot app modernization - upgrade for .NET extension in Visual Studio. + +## Prerequisites + +- Windows Operating System +- [Visual Studio 2022 version 17.14 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). + +## 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 the **Extension Manager** window. +01. Select the **Browse** tab. +01. Type **GitHub Copilot App Modernization** into the search box. +01. Select the **GitHub Copilot App Modernization** item, 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 the 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 + +The following information helps you determine that GitHub Copilot App Modernization is installed. + +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 the **Solution Explorer** window and check for an **Upgrade** 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 - upgrade for .NET?](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 new file mode 100644 index 0000000000000..48269609e0fb4 --- /dev/null +++ b/docs/core/porting/github-copilot-app-modernization-overview.md @@ -0,0 +1,195 @@ +--- +title: GitHub Copilot app modernization - upgrade for .NET Overview +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." +titleSuffix: "" +author: adegeo +ms.author: adegeo +ms.topic: overview +ms.date: 05/16/2025 + +#customer intent: As a developer, I want to upgrade my project so that I can take advantage of the latest features. + +--- + +# What is GitHub Copilot app modernization - upgrade for .NET? + +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. + +GitHub Copilot app modernization is distributed as a Visual Studio extension, and is an interactive upgrade process. + +## Prerequisites + +- Windows Operating System +- [Visual Studio 2022 version 17.14 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). +- [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). + - You can use [GitHub Copilot for free](/visualstudio/ide/copilot-free-plan). +- Code must be in a local Git repository. +- Code must be written in C#. +- 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). + +For installation instructions, see [Install GitHub Copilot app modernization - upgrade for .NET](github-copilot-app-modernization-install.md). + +## Supported project types + +GitHub Copilot app modernization 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 +- Blazor +- Azure Functions +- Windows Presentation Foundation +- Windows Forms +- Class libraries +- Console apps + +> [!IMPORTANT] +> 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. + +## Upgrade paths + +The following upgrade paths are supported: + +- Upgrade projects from .NET Core to .NET. +- Upgrade projects from older versions of .NET to the latest. +- Modernize your code base. + +## Start the upgrade process + +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: + +- Right-click on the solution or project and select **Upgrade with GitHub Copilot**. + + —or— + +- [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. + + > [!IMPORTANT] + > After enabling GitHub Copilot agent mode, set the chat mode to **Agent** and enable the **upgrade_start** tool. + > + > :::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."::: + +## Generate a plan + +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. + +You can adjust the plan by editing the markdown file to change the upgrade steps or add more context. + +> [!CAUTION] +> 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. + +The following snippet demonstrates the structure of a plan: + +```md +# .NET 9.0 Upgrade Plan + +## Execution Steps + +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. +2. Ensure that the SDK version specified in global.json files is compatible with the .NET 9.0 upgrade. +3. Upgrade projects to .NET 9.0. + - 3.1. Upgrade RazorMovie.csproj + - 3.2. Upgrade RazorMovie.Tests.csproj +4. Run unit tests to validate upgrade in the projects listed below: + - RazorMovie.Tests.csproj + +## Settings + +This section contains settings and data used by execution steps. + +### Aggregate NuGet packages modifications across all projects + +NuGet packages used across all selected projects or their dependencies that need version update in projects that reference them. + +| Package Name | Current Version | New Version | Description | +|:-------------------------------------------------|:-------------------:|:-----------:|:-------------------------| +| HtmlSanitizer | 7.1.542 | 9.0.884 | Security vulnerability | +| Microsoft.Data.SqlClient | 4.0.5 | 6.0.2 | Deprecated | +| Microsoft.EntityFrameworkCore.Design | 6.0.0-rtm.21467.1 | 9.0.5 | Recommended for .NET 9.0 | +| Microsoft.EntityFrameworkCore.SqlServer | 6.0.0-rc.1.21452.10 | 9.0.5 | Recommended for .NET 9.0 | +| Microsoft.EntityFrameworkCore.Tools | 6.0.0-rc.1.21452.10 | 9.0.5 | Recommended for .NET 9.0 | +| Microsoft.VisualStudio.Web.CodeGeneration.Design | 6.0.0-rc.1.21464.1 | 9.0.0 | Recommended for .NET 9.0 | + +... +``` + +## Perform the upgrade + +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. + +The tool differs in experience based on whether or not Copilot _agent mode_ is enabled. + +- **Copilot agent mode** + + 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. + +- **Copilot fix mode** + + 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. + +Each major step in the upgrade process is committed to the local Git repository. + +## Upgrade results + +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. + +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: + +```md +# .NET 9 Upgrade Report + +## Project modifications + +| Project name | Old Target Framework | New Target Framework | Commits | +|:-----------------------------------------------|:-----------------------:|:----------------------------:|---------------------------| +| RazorMovie | net6.0 | net9.0 | af8cf633, aa61a18d | +| MvcMovie | net6.0 | net9.0 | cc8c9015 | +| WpfMovie | net6.0-windows | net9.0-windows | 9c4b13f9 | +| RazorMovie.Tests | net6.0 | net9.0 | b8d85e97 | +| MvcMovie.Tests | net6.0 | net9.0 | b8d85e97 | +| WpfMovie.Tests | net6.0-windows | net9.0-windows7.0 | b8d85e97 | + +## NuGet Packages + +| Package Name | Old Version | New Version | Commit Id | +|:-------------------------------------------------|:-------------------:|:-----------:|-----------| +| HtmlSanitizer | 7.1.542 | 9.0.884 | af8cf633 | +| Microsoft.Data.SqlClient | 4.0.5 | 6.0.2 | bf8deeac | +| Microsoft.EntityFrameworkCore.Design | 6.0.0-rtm.21467.1 | 9.0.5 | bf8deeac | +| Microsoft.EntityFrameworkCore.SqlServer | 6.0.0-rc.1.21452.10 | 9.0.5 | bf8deeac | +| Microsoft.EntityFrameworkCore.Tools | 6.0.0-rc.1.21452.10 | 9.0.5 | bf8deeac | +| Microsoft.VisualStudio.Web.CodeGeneration.Design | 6.0.0-rc.1.21464.1 | 9.0.0 | bf8deeac | + +## All commits + +| Commit ID | Description | +|:----------|:--------------------------------------------------------| +| af8cf633 | Update HtmlSanitizer package in RazorMovie.csproj | +| aa61a18d | Upgrade target framework in RazorMovie.csproj | +| cc8c9015 | Upgrade to .NET 9 and update dependencies | +| bf8deeac | Update package references in MvcMovie.csproj | +| 9c4b13f9 | Update WpfMovie.csproj to target .NET 9.0 | +| b8d85e97 | Update test projects to .NET 9 and enhance dependencies | + +## Test Results + +| Project Name | Passed | Failed | Skipped | +|:-----------------------|:------:|:------:|:-------:| +| RazorMovie.Tests | 0 | 0 | 0 | +| MvcMovie.Tests | 2 | 0 | 0 | +| WpfMovie.Tests | 6 | 1 | 0 | + +## Next steps + +- Review the test results and address the single failing test in `WpfMovie.Tests`. +- Ensure all updated NuGet packages are compatible with your application. +- Leverage new features and improvements in .NET 9.0 for your projects. +``` + +## Telemetry + +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). + +## Related content + +- [Install GitHub Copilot app modernization - upgrade for .NET](github-copilot-app-modernization-install.md) +- [GitHub Copilot app modernization - upgrade for .NET FAQ](github-copilot-app-modernization-faq.yml) diff --git a/docs/core/porting/media/github-copilot-app-modernization-install/install-prompt.png b/docs/core/porting/media/github-copilot-app-modernization-install/install-prompt.png new file mode 100644 index 0000000000000..a8a7c91efc46f Binary files /dev/null and b/docs/core/porting/media/github-copilot-app-modernization-install/install-prompt.png differ diff --git a/docs/core/porting/media/github-copilot-app-modernization-install/visual-studio-manage-extensions.png b/docs/core/porting/media/github-copilot-app-modernization-install/visual-studio-manage-extensions.png new file mode 100644 index 0000000000000..d3b3264dbb53f Binary files /dev/null and b/docs/core/porting/media/github-copilot-app-modernization-install/visual-studio-manage-extensions.png differ diff --git a/docs/core/porting/media/github-copilot-app-modernization-overview/copilot-agent-tools.png b/docs/core/porting/media/github-copilot-app-modernization-overview/copilot-agent-tools.png new file mode 100644 index 0000000000000..b879362197d99 Binary files /dev/null and b/docs/core/porting/media/github-copilot-app-modernization-overview/copilot-agent-tools.png differ diff --git a/docs/fundamentals/diagnostics/runtime-events.md b/docs/fundamentals/diagnostics/runtime-events.md index f39bb6e4d65f6..d086fc15d88ab 100644 --- a/docs/fundamentals/diagnostics/runtime-events.md +++ b/docs/fundamentals/diagnostics/runtime-events.md @@ -43,3 +43,6 @@ These events collect information about the type system. [Tiered compilation events](runtime-tiered-compilation-events.md)\ These events collect information about tiered compilation. + +[Wait handle events](runtime-wait-handle-events.md)\ +These events collect information about wait handles. They help to diagnostic thread pool starvations. diff --git a/docs/fundamentals/diagnostics/runtime-wait-handle-events.md b/docs/fundamentals/diagnostics/runtime-wait-handle-events.md new file mode 100644 index 0000000000000..2820c22fcbbed --- /dev/null +++ b/docs/fundamentals/diagnostics/runtime-wait-handle-events.md @@ -0,0 +1,55 @@ +--- +title: "Wait handle runtime events" +description: See ETW events that collect information specific to the wait handles. +ms.date: "05/27/2024" +helpviewer_keywords: + - "wait handle events (CoreCLR)" + - "ETW, EventPipe, LTTng wait handle events (CoreCLR)" +--- + +# .NET runtime wait handle events + +These runtime events capture information about wait handles. They can be useful to investigate thread pool starvation issues. For more information about how to use these events for diagnostic purposes, see [logging and tracing .NET applications](../../core/diagnostics/logging-tracing.md) + +## WaitHandleWaitStart event + +This event is emitted at the start of a wait operation on a wait handle. Here is a non-exhaustive list of managed method that could emit this event: + +- `Monitor.Wait` +- `Monitor.Enter` or the C# lock keyword +- `ManualResetEvent.WaitOne` +- `Task.Wait` + +|Keyword for raising the event|Level| +|-----------------------------------|-----------| +|`WaitHandleKeyword` (0x40000000000)|Verbose (5)| + +The following table shows event information. + +|Event|Event ID|Raised when| +|-----------|--------------|-----------------| +|`WaitHandleWaitStart`|301|A wait starts.| + +|Field name|Data type|Description| +|----------------|---------------|-----------------| +|`WaitSource`|`win:UInt8`|`0x0` - Other sources.

`0x1` - The wait originated from managed code through the `Monitor.Wait` method.| +|`AssociatedObjectID`|`win:Pointer`|Address of the associated object (e.g. address of `obj` in the code `lock(obj) {}`).| +|`ClrInstanceID`|`win:UInt16`|Unique ID for the instance of CoreCLR.| + +## WaitHandleWaitStop event + +This event is emitted at the end of a wait operation on a wait handle. + +|Keyword for raising the event|Level| +|-----------------------------------|-----------| +|`WaitHandleKeyword` (0x40000000000)|Verbose (5)| + +The following table shows event information. + +|Event|Event ID|Raised when| +|-----------|--------------|-----------------| +|`WaitHandleWaitStop`|302|A wait stops.| + +|Field name|Data type|Description| +|----------------|---------------|-----------------| +|`ClrInstanceID`|`win:UInt16`|Unique ID for the instance of CoreCLR.| diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Program.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Program.cs new file mode 100644 index 0000000000000..99e6662d51bc0 --- /dev/null +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Program.cs @@ -0,0 +1 @@ +CustomFormatEx.Run(); diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Project.csproj b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Project.csproj index 251a8cb33ffed..5ed8f36be8cd5 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Project.csproj +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/Project.csproj @@ -1,8 +1,8 @@ - Library - net8 + Exe + net9 diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/create1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/create1.cs index 6ee26e1f5d796..10d20d59111f9 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/create1.cs +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/create1.cs @@ -4,7 +4,7 @@ public class CreateEx { - public static void Main() + public static void Run() { // Create a complex number by calling its class constructor. Complex c1 = new Complex(12, 6); diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/customfmt1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/customfmt1.cs index 3229bb7cf2dc7..496a4a4e92f6f 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/customfmt1.cs +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/customfmt1.cs @@ -15,17 +15,16 @@ public object GetFormat(Type formatType) public string Format(string format, object arg, IFormatProvider provider) { - if (arg is Complex) + if (arg is Complex c1) { - Complex c1 = (Complex)arg; // Check if the format string has a precision specifier. int precision; - string fmtString = String.Empty; + string fmtString = string.Empty; if (format.Length > 1) { try { - precision = Int32.Parse(format.Substring(1)); + precision = int.Parse(format.Substring(1)); } catch (FormatException) { @@ -42,12 +41,12 @@ public string Format(string format, object arg, } else { - if (arg is IFormattable) - return ((IFormattable)arg).ToString(format, provider); + if (arg is IFormattable formattable) + return formattable.ToString(format, provider); else if (arg != null) return arg.ToString(); else - return String.Empty; + return string.Empty; } } } @@ -56,22 +55,21 @@ public string Format(string format, object arg, // public class CustomFormatEx { - public static void Main() + public static void Run() { - Complex c1 = new Complex(12.1, 15.4); - Console.WriteLine("Formatting with ToString(): " + - c1.ToString()); - Console.WriteLine("Formatting with ToString(format): " + - c1.ToString("N2")); - Console.WriteLine("Custom formatting with I0: " + - String.Format(new ComplexFormatter(), "{0:I0}", c1)); - Console.WriteLine("Custom formatting with J3: " + - String.Format(new ComplexFormatter(), "{0:J3}", c1)); + Complex c1 = new(12.1, 15.4); + Console.WriteLine($"Formatting with ToString: {c1}"); + Console.WriteLine($"Formatting with ToString(format): {c1:N2}"); + Console.WriteLine($"Custom formatting with I0:\t" + + $" {string.Format(new ComplexFormatter(), "{0:I0}", c1)}"); + Console.WriteLine($"Custom formatting with J3:\t" + + $" {string.Format(new ComplexFormatter(), "{0:J3}", c1)}"); } } + // The example displays the following output: -// Formatting with ToString(): (12.1, 15.4) -// Formatting with ToString(format): (12.10, 15.40) +// Formatting with ToString(): <12.1; 15.4> +// Formatting with ToString(format): <12.10; 15.40> // Custom formatting with I0: 12 + 15i // Custom formatting with J3: 12.100 + 15.400j // diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/nan1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/nan1.cs index ae5c738d3eeca..c91485224155b 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/nan1.cs +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/nan1.cs @@ -4,7 +4,7 @@ public class NaNEx { - public static void Main() + public static void Run() { Complex c1 = new Complex(Double.MaxValue / 2, Double.MaxValue / 2); diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/precision1.cs b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/precision1.cs index 47626a472219c..c2e851c3b5a49 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/precision1.cs +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/precision1.cs @@ -1,9 +1,9 @@ -using System; +using System; using System.Numerics; public class PrecisionEx { - public static void Main() + public static void Run() { // Complex value = new Complex(Double.MinValue / 2, Double.MinValue / 2); diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Program.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Program.vb new file mode 100644 index 0000000000000..8cd0a0ebcc1ee --- /dev/null +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Program.vb @@ -0,0 +1,5 @@ +Public Class Program + Public Shared Sub Main() + Example2.Run() + End Sub +End Class diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Project.vbproj b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Project.vbproj index 251a8cb33ffed..5ed8f36be8cd5 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Project.vbproj +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/Project.vbproj @@ -1,8 +1,8 @@ - Library - net8 + Exe + net9 diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/create1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/create1.vb index eb9e5a73bd268..fdfaf39259663 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/create1.vb +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/create1.vb @@ -5,7 +5,7 @@ Option Strict On Imports System.Numerics Module Example - Public Sub Main() + Public Sub Run() ' Create a complex number by calling its class constructor. Dim c1 As New Complex(12, 6) Console.WriteLine(c1) diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/customfmt1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/customfmt1.vb index 7c197d17d8735..ee1efcfb2401b 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/customfmt1.vb +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/customfmt1.vb @@ -26,7 +26,7 @@ Public Class ComplexFormatter Dim fmtString As String = String.Empty If fmt.Length > 1 Then Try - precision = Int32.Parse(fmt.Substring(1)) + precision = Integer.Parse(fmt.Substring(1)) Catch e As FormatException precision = 0 End Try @@ -54,21 +54,20 @@ End Class ' Module Example2 - Public Sub Main() - Dim c1 As Complex = New Complex(12.1, 15.4) - Console.WriteLine("Formatting with ToString(): " + - c1.ToString()) - Console.WriteLine("Formatting with ToString(format): " + - c1.ToString("N2")) - Console.WriteLine("Custom formatting with I0: " + - String.Format(New ComplexFormatter(), "{0:I0}", c1)) - Console.WriteLine("Custom formatting with J3: " + - String.Format(New ComplexFormatter(), "{0:J3}", c1)) + Public Sub Run() + Dim c1 As New Complex(12.1, 15.4) + Console.WriteLine($"Formatting with ToString(): {c1}") + Console.WriteLine($"Formatting with ToString(format): {c1:N2}") + Console.WriteLine($"Custom formatting with I0: " + + $"{String.Format(New ComplexFormatter(), "{0:I0}", c1)}") + Console.WriteLine($"Custom formatting with J3: " + + $"{String.Format(New ComplexFormatter(), "{0:J3}", c1)}") End Sub End Module + ' The example displays the following output: -' Formatting with ToString(): (12.1, 15.4) -' Formatting with ToString(format): (12.10, 15.40) +' Formatting with ToString(): <12.1; 15.4> +' Formatting with ToString(format): <12.10; 15.40> ' Custom formatting with I0: 12 + 15i ' Custom formatting with J3: 12.100 + 15.400j ' diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/nan1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/nan1.vb index 8d178915a2abd..b794990719e2c 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/nan1.vb +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/nan1.vb @@ -5,7 +5,7 @@ Option Strict On Imports System.Numerics Module Example4 - Public Sub Main() + Public Sub Run() Dim c1 As Complex = New Complex(Double.MaxValue / 2, Double.MaxValue / 2) Dim c2 As Complex = c1 / Complex.Zero diff --git a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/precision1.vb b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/precision1.vb index f677a474ff0da..32247a08f2201 100644 --- a/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/precision1.vb +++ b/docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/vb/precision1.vb @@ -4,7 +4,7 @@ Option Strict On Imports System.Numerics Module Example3 - Public Sub Main() + Public Sub Run() ' Dim value As New Complex(Double.MinValue / 2, Double.MinValue / 2) Dim value2 As Complex = Complex.Exp(Complex.Log(value)) diff --git a/docs/fundamentals/runtime-libraries/system-numerics-complex.md b/docs/fundamentals/runtime-libraries/system-numerics-complex.md index 3bb6bac6108b0..9724114c4c5fd 100644 --- a/docs/fundamentals/runtime-libraries/system-numerics-complex.md +++ b/docs/fundamentals/runtime-libraries/system-numerics-complex.md @@ -1,7 +1,7 @@ --- title: System.Numerics.Complex struct description: Learn about the System.Numerics.Complex struct. -ms.date: 12/31/2023 +ms.date: 05/15/2025 dev_langs: - CSharp - VB @@ -85,11 +85,11 @@ Note that this applies to any intermediate calculations performed by a method. F ## Format a complex number -By default, the string representation of a complex number takes the form `(`*real*`,` *imaginary*`)`, where *real* and *imaginary* are the string representations of the values that form the complex number's real and imaginary components. Some overloads of the method allow customization of the string representations of these values to reflect the formatting conventions of a particular culture or to appear in a particular format defined by a standard or custom numeric format string. (For more information, see [Standard Numeric Format Strings](../../standard/base-types/standard-numeric-format-strings.md) and [Custom Numeric Format Strings](../../standard/base-types/custom-numeric-format-strings.md).) +By default, the string representation of a complex number takes the form `<`*real*`;` *imaginary*`>`, where *real* and *imaginary* are the string representations of the values that form the complex number's real and imaginary components. Some overloads of the method allow customization of the string representations of these values to reflect the formatting conventions of a particular culture or to appear in a particular format defined by a standard or custom numeric format string. (For more information, see [Standard Numeric Format Strings](../../standard/base-types/standard-numeric-format-strings.md) and [Custom Numeric Format Strings](../../standard/base-types/custom-numeric-format-strings.md).) -One of the more common ways of expressing the string representation of a complex number takes the form a + bi, where a is the complex number's real component, and b is the complex number's imaginary component. In electrical engineering, a complex number is most commonly expressed as a + bj. You can return the string representation of a complex number in either of these two forms. To do this, define a custom format provider by implementing the and interfaces, and then call the method. +One of the more common ways of expressing the string representation of a complex number takes the form `a + bi`, where `a` is the complex number's real component, and `b` is the complex number's imaginary component. In electrical engineering, a complex number is most commonly expressed as `a + bj`. You can return the string representation of a complex number in either of these two forms. To do this, define a custom format provider by implementing the and interfaces, and then call the method. -The following example defines a `ComplexFormatter` class that represents a complex number as a string in the form of either a + bi or a + bj. +The following example defines a `ComplexFormatter` class that represents a complex number as a string in the form of either `a + bi` or `a + bj`. :::code language="csharp" source="./snippets/System.Numerics/Complex/Overview/csharp/customfmt1.cs" id="Snippet1"::: :::code language="vb" source="./snippets/System.Numerics/Complex/Overview/vb/customfmt1.vb" id="Snippet1"::: diff --git a/docs/navigate/migration-guide/toc.yml b/docs/navigate/migration-guide/toc.yml index b138b9b1e3c22..83e19f085f216 100644 --- a/docs/navigate/migration-guide/toc.yml +++ b/docs/navigate/migration-guide/toc.yml @@ -12,6 +12,17 @@ items: href: ../../core/porting/versioning-sdk-msbuild-vs.md - name: Choose between .NET and .NET Framework for server apps href: ../../standard/choosing-core-framework-server.md + - name: GitHub Copilot app modernization + items: + - name: Overview + href: ../../core/porting/github-copilot-app-modernization-overview.md + displayName: copilot, upgrade + - name: Install + href: ../../core/porting/github-copilot-app-modernization-install.md + displayName: copilot, upgrade + - name: FAQ + href: ../../core/porting/github-copilot-app-modernization-faq.yml + displayName: copilot, upgrade, faq - name: .NET Upgrade Assistant tool items: - name: Overview