- generic [active] [ref=f2e1]: - generic [ref=f2e4]: - link "Skip to main content" [ref=f2e5] [cursor=pointer]: - /url: "#main-content" - banner [ref=f2e6]: - navigation "Primary" [ref=f2e7]: - link "Awesome GitHub Copilot" [ref=f2e8] [cursor=pointer]: - /url: / - list [ref=f2e11]: - listitem [ref=f2e12]: - group [ref=f2e13]: - generic "Resources" [ref=f2e14] [cursor=pointer] - listitem [ref=f2e17]: - link "Playbook" [ref=f2e18] [cursor=pointer]: - /url: /learning-hub/ - generic [ref=f2e19]: - button "Search" [ref=f2e21] [cursor=pointer] - link "Meet all 0 contributors" [ref=f2e24] [cursor=pointer]: - /url: /contributors/ - generic [ref=f2e28]: "0" - 'button "Language: English" [ref=f2e30] [cursor=pointer]': - generic [ref=f2e34]: English - link "Contribute" [ref=f2e39] [cursor=pointer]: - /url: https://github.com/github/awesome-copilot/blob/main/CONTRIBUTING.md - main [ref=f2e42]: - generic [ref=f2e43]: - generic [ref=f2e47]: - navigation "Breadcrumbs" [ref=f2e49]: - list [ref=f2e50]: - listitem [ref=f2e51]: - link "Agents" [ref=f2e52] [cursor=pointer]: - /url: /agents/ - listitem [ref=f2e55]: - generic: .NET Upgrade - generic [ref=f2e56]: - heading ".NET Upgrade" [level=1] [ref=f2e57] - paragraph [ref=f2e58]: Perform janitorial tasks on C#/.NET code including cleanup, modernization, and tech debt remediation. - generic [ref=f2e59]: - generic [ref=f2e61]: - link "Install" [ref=f2e62] [cursor=pointer]: - /url: https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%253A%252F%252Fraw.githubusercontent.com%252Fgithub%252Fawesome-copilot%252Fmain%252Fagents%252Fdotnet-upgrade.agent.md - button "Menu" [ref=f2e65] [cursor=pointer] - link "View the .NET Upgrade agent on GitHub" [ref=f2e70] [cursor=pointer]: - /url: https://github.com/github/awesome-copilot/blob/main/agents/dotnet-upgrade.agent.md - link "Download the .NET Upgrade agent file" [ref=f2e75] [cursor=pointer]: - /url: https://raw.githubusercontent.com/github/awesome-copilot/main/agents/dotnet-upgrade.agent.md - generic [ref=f2e84]: - generic [ref=f2e85]: - article [ref=f2e86]: - generic [ref=f2e88]: - heading ".NET Upgrade Collection" [level=1] [ref=f2e89] - paragraph [ref=f2e90]: .NET Framework upgrade specialist for comprehensive project migration - paragraph [ref=f2e91]: - strong [ref=f2e92]: "Tags:" - text: dotnet, upgrade, migration, framework, modernization - heading "Collection Usage" [level=2] [ref=f2e93] - heading ".NET Upgrade Chat Mode" [level=3] [ref=f2e94] - paragraph [ref=f2e95]: Discover and plan your .NET upgrade journey! - code [ref=f2e97]: "--- mode: dotnet-upgrade title: Analyze current .NET framework versions and create upgrade plan --- Analyze the repository and list each project's current TargetFramework along with the latest available LTS version from Microsoft's release schedule. Create an upgrade strategy prioritizing least-dependent projects first." - paragraph [ref=f2e98]: The upgrade chat mode automatically adapts to your repository's current .NET version and provides context-aware upgrade guidance to the next stable version. - paragraph [ref=f2e99]: "It will help you:" - list [ref=f2e100]: - listitem [ref=f2e101]: Auto-detect current .NET versions across all projects - listitem [ref=f2e102]: Generate optimal upgrade sequences - listitem [ref=f2e103]: Identify breaking changes and modernization opportunities - listitem [ref=f2e104]: Create per-project upgrade flows - separator [ref=f2e105] - heading ".NET Upgrade Instructions" [level=3] [ref=f2e106] - paragraph [ref=f2e107]: Execute comprehensive .NET framework upgrades with structured guidance! - paragraph [ref=f2e108]: "The instructions provide:" - list [ref=f2e109]: - listitem [ref=f2e110]: Sequential upgrade strategies - listitem [ref=f2e111]: Dependency analysis and sequencing - listitem [ref=f2e112]: Framework targeting and code adjustments - listitem [ref=f2e113]: NuGet and dependency management - listitem [ref=f2e114]: CI/CD pipeline updates - listitem [ref=f2e115]: Testing and validation procedures - paragraph [ref=f2e116]: Use these instructions when implementing upgrade plans to ensure proper execution and validation. - separator [ref=f2e117] - heading ".NET Upgrade Prompts" [level=3] [ref=f2e118] - paragraph [ref=f2e119]: Quick access to specialized upgrade analysis prompts! - paragraph [ref=f2e120]: "The prompts collection includes ready-to-use queries for:" - list [ref=f2e121]: - listitem [ref=f2e122]: Project discovery and assessment - listitem [ref=f2e123]: Upgrade strategy and sequencing - listitem [ref=f2e124]: Framework targeting and code adjustments - listitem [ref=f2e125]: Breaking change analysis - listitem [ref=f2e126]: CI/CD pipeline updates - listitem [ref=f2e127]: Final validation and delivery - paragraph [ref=f2e128]: Use these prompts for targeted analysis of specific upgrade aspects. - separator [ref=f2e129] - heading "Quick Start" [level=2] [ref=f2e130] - list [ref=f2e131]: - listitem [ref=f2e132]: - text: Run a discovery pass to enumerate all - code [ref=f2e133]: "*.sln" - text: and - code [ref=f2e134]: "*.csproj" - text: files in the repository. - listitem [ref=f2e135]: Detect the current .NET version(s) used across projects. - listitem [ref=f2e136]: - text: Identify the latest available stable .NET version (LTS preferred) — usually - code [ref=f2e137]: "+2" - text: years ahead of the existing version. - listitem [ref=f2e138]: - text: Generate an upgrade plan to move from current → next stable version (e.g., - code [ref=f2e139]: net6.0 → net8.0 - text: ", or" - code [ref=f2e140]: net7.0 → net9.0 - text: ). - listitem [ref=f2e141]: Upgrade one project at a time, validate builds, update tests, and modify CI/CD accordingly. - separator [ref=f2e142] - heading "Auto-Detect Current .NET Version" [level=2] [ref=f2e143] - paragraph [ref=f2e144]: "To automatically detect the current framework versions across the solution:" - code [ref=f2e146]: "# 1. Check global SDKs installed dotnet --list-sdks # 2. Detect project-level TargetFrameworks find . -name \"*.csproj\" -exec grep -H \"//;s/<\\/TargetFramework>//' | sort | uniq # 4. Verify runtime environment dotnet --info | grep \"Version\"" - paragraph [ref=f2e147]: - strong [ref=f2e148]: "Chat Prompt:" - blockquote [ref=f2e149]: - paragraph [ref=f2e150]: "\"Analyze the repository and list each project’s current TargetFramework along with the latest available LTS version from Microsoft’s release schedule.\"" - separator [ref=f2e151] - heading "Discovery & Analysis Commands" [level=2] [ref=f2e152] - code [ref=f2e154]: "# List all projects dotnet sln list # Check current target frameworks for each project grep -H \"TargetFramework\" **/*.csproj # Check outdated packages dotnet list .csproj package --outdated # Generate dependency graph dotnet msbuild .csproj /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=graph.json" - paragraph [ref=f2e155]: - strong [ref=f2e156]: "Chat Prompt:" - blockquote [ref=f2e157]: - paragraph [ref=f2e158]: "\"Analyze the solution and summarize each project’s current TargetFramework and suggest the appropriate next LTS upgrade version.\"" - separator [ref=f2e159] - heading "Classification Rules" [level=2] [ref=f2e160] - list [ref=f2e161]: - listitem [ref=f2e162]: - code [ref=f2e163]: TargetFramework - text: starts with - code [ref=f2e164]: netcoreapp - text: "," - code [ref=f2e165]: net5.0+ - text: "," - code [ref=f2e166]: net6.0+ - text: ", etc. →" - strong [ref=f2e167]: Modern .NET - listitem [ref=f2e168]: - code [ref=f2e169]: netstandard* - text: → - strong [ref=f2e170]: .NET Standard - text: (migrate to current .NET version) - listitem [ref=f2e171]: - code [ref=f2e172]: net4* - text: → - strong [ref=f2e173]: .NET Framework - text: (migrate via intermediate step to .NET 8+) - separator [ref=f2e174] - heading "Upgrade Sequence" [level=2] [ref=f2e175] - list [ref=f2e176]: - listitem [ref=f2e177]: - strong [ref=f2e178]: "Start with Independent Libraries:" - text: Least dependent class libraries first. - listitem [ref=f2e179]: - strong [ref=f2e180]: "Next:" - text: Shared components and common utilities. - listitem [ref=f2e181]: - strong [ref=f2e182]: "Then:" - text: API, Web, or Function projects. - listitem [ref=f2e183]: - strong [ref=f2e184]: "Finally:" - text: Tests, integration points, and pipelines. - paragraph [ref=f2e185]: - strong [ref=f2e186]: "Chat Prompt:" - blockquote [ref=f2e187]: - paragraph [ref=f2e188]: "\"Generate the optimal upgrade order for this repository, prioritizing least-dependent projects first.\"" - separator [ref=f2e189] - heading "Per-Project Upgrade Flow" [level=2] [ref=f2e190] - list [ref=f2e191]: - listitem [ref=f2e192]: - strong [ref=f2e193]: "Create branch:" - code [ref=f2e194]: upgrade/-to- - listitem [ref=f2e195]: - strong [ref=f2e196]: - text: Edit - code [ref=f2e197]: - text: in - code [ref=f2e198]: .csproj - text: to the suggested version (e.g., - code [ref=f2e199]: net9.0 - text: ) - listitem [ref=f2e200]: - strong [ref=f2e201]: "Restore & update packages:" - code [ref=f2e203]: dotnet restore dotnet list package --outdated dotnet add package --version - listitem [ref=f2e204]: - strong [ref=f2e205]: "Build & test:" - code [ref=f2e207]: dotnet build .csproj dotnet test .Tests.csproj - listitem [ref=f2e208]: - strong [ref=f2e209]: Fix issues - text: — resolve deprecated APIs, adjust configurations, modernize JSON/logging/DI. - listitem [ref=f2e210]: - strong [ref=f2e211]: Commit & push - text: PR with test evidence and checklist. - separator [ref=f2e212] - heading "Breaking Changes & Modernization" [level=2] [ref=f2e213] - list [ref=f2e214]: - listitem [ref=f2e215]: - text: Use - code [ref=f2e216]: .NET Upgrade Assistant - text: for initial recommendations. - listitem [ref=f2e217]: Apply analyzers to detect obsolete APIs. - listitem [ref=f2e218]: - text: Replace outdated SDKs (e.g., - code [ref=f2e219]: Microsoft.Azure.* - text: → - code [ref=f2e220]: Azure.* - text: ). - listitem [ref=f2e221]: - text: Modernize startup logic ( - code [ref=f2e222]: Startup.cs - text: → - code [ref=f2e223]: Program.cs - text: top-level statements). - paragraph [ref=f2e224]: - strong [ref=f2e225]: "Chat Prompt:" - blockquote [ref=f2e226]: - paragraph [ref=f2e227]: "\"List deprecated or incompatible APIs when upgrading from to for .\"" - separator [ref=f2e228] - heading "CI/CD Configuration Updates" [level=2] [ref=f2e229] - paragraph [ref=f2e230]: - text: Ensure pipelines use the detected - strong [ref=f2e231]: target version - text: "dynamically:" - paragraph [ref=f2e232]: - strong [ref=f2e233]: Azure DevOps - code [ref=f2e235]: "- task: UseDotNet@2 inputs: packageType: 'sdk' version: '$(TargetDotNetVersion).x'" - paragraph [ref=f2e236]: - strong [ref=f2e237]: GitHub Actions - code [ref=f2e239]: "- uses: actions/setup-dotnet@v4 with: dotnet-version: '${{ env.TargetDotNetVersion }}.x'" - separator [ref=f2e240] - heading "Validation Checklist" [level=2] [ref=f2e241] - list [ref=f2e242]: - listitem [ref=f2e243]: - checkbox "Incomplete task" [disabled] [ref=f2e244] - text: TargetFramework upgraded to next stable version - listitem [ref=f2e245]: - checkbox "Incomplete task" [disabled] [ref=f2e246] - text: All NuGet packages compatible and updated - listitem [ref=f2e247]: - checkbox "Incomplete task" [disabled] [ref=f2e248] - text: Build and test pipelines succeed locally and in CI - listitem [ref=f2e249]: - checkbox "Incomplete task" [disabled] [ref=f2e250] - text: Integration tests pass - listitem [ref=f2e251]: - checkbox "Incomplete task" [disabled] [ref=f2e252] - text: Deployed to a lower environment and verified - separator [ref=f2e253] - heading "Branching & Rollback Strategy" [level=2] [ref=f2e254] - list [ref=f2e255]: - listitem [ref=f2e256]: - text: "Use feature branches:" - code [ref=f2e257]: upgrade/-to- - listitem [ref=f2e258]: Commit frequently and keep changes atomic - listitem [ref=f2e259]: If CI fails after merge, revert PR and isolate failing modules - paragraph [ref=f2e260]: - strong [ref=f2e261]: "Chat Prompt:" - blockquote [ref=f2e262]: - paragraph [ref=f2e263]: "\"Suggest a rollback and validation plan if the .NET upgrade for introduces build or runtime regressions.\"" - separator [ref=f2e264] - heading "Automation & Scaling" [level=2] [ref=f2e265] - list [ref=f2e266]: - listitem [ref=f2e267]: Automate upgrade detection with GitHub Actions or Azure Pipelines. - listitem [ref=f2e268]: - text: Schedule nightly runs to check for new .NET releases via - code [ref=f2e269]: dotnet --list-sdks - text: . - listitem [ref=f2e270]: Use agents to automatically raise PRs for outdated frameworks. - separator [ref=f2e271] - heading "Chatmode Prompt Library" [level=2] [ref=f2e272] - list [ref=f2e273]: - listitem [ref=f2e274]: "\"List all projects with current and recommended .NET versions.\"" - listitem [ref=f2e275]: "\"Generate a per-project upgrade plan from to .\"" - listitem [ref=f2e276]: "\"Suggest .csproj and pipeline edits to upgrade .\"" - listitem [ref=f2e277]: "\"Summarize build/test results post-upgrade for .\"" - listitem [ref=f2e278]: "\"Create PR description and checklist for the upgrade.\"" - separator [ref=f2e279] - complementary [ref=f2e280]: - generic [ref=f2e281]: - generic [ref=f2e282]: - generic [ref=f2e283]: In this article - navigation "In this article" [ref=f2e285]: - list [ref=f2e286]: - listitem [ref=f2e287]: - link "Collection Usage" [ref=f2e288] [cursor=pointer]: - /url: "#collection-usage" - listitem [ref=f2e289]: - link "Quick Start" [ref=f2e290] [cursor=pointer]: - /url: "#quick-start" - listitem [ref=f2e291]: - link "Auto-Detect Current .NET Version" [ref=f2e292] [cursor=pointer]: - /url: "#auto-detect-current-net-version" - listitem [ref=f2e293]: - link "Discovery & Analysis Commands" [ref=f2e294] [cursor=pointer]: - /url: "#discovery-analysis-commands" - listitem [ref=f2e295]: - link "Classification Rules" [ref=f2e296] [cursor=pointer]: - /url: "#classification-rules" - listitem [ref=f2e297]: - link "Upgrade Sequence" [ref=f2e298] [cursor=pointer]: - /url: "#upgrade-sequence" - listitem [ref=f2e299]: - link "Per-Project Upgrade Flow" [ref=f2e300] [cursor=pointer]: - /url: "#per-project-upgrade-flow" - listitem [ref=f2e301]: - link "Breaking Changes & Modernization" [ref=f2e302] [cursor=pointer]: - /url: "#breaking-changes-modernization" - listitem [ref=f2e303]: - link "CI/CD Configuration Updates" [ref=f2e304] [cursor=pointer]: - /url: "#ci-cd-configuration-updates" - listitem [ref=f2e305]: - link "Validation Checklist" [ref=f2e306] [cursor=pointer]: - /url: "#validation-checklist" - listitem [ref=f2e307]: - link "Branching & Rollback Strategy" [ref=f2e308] [cursor=pointer]: - /url: "#branching-rollback-strategy" - listitem [ref=f2e309]: - link "Automation & Scaling" [ref=f2e310] [cursor=pointer]: - /url: "#automation-scaling" - listitem [ref=f2e311]: - link "Chatmode Prompt Library" [ref=f2e312] [cursor=pointer]: - /url: "#chatmode-prompt-library" - generic [ref=f2e313]: - generic [ref=f2e314]: Agent details - generic [ref=f2e316]: - generic [ref=f2e317]: - generic [ref=f2e318]: Tools - generic [ref=f2e319]: - generic [ref=f2e320]: codebase - generic [ref=f2e321]: edit/editFiles - generic [ref=f2e322]: search - generic [ref=f2e323]: runCommands - generic [ref=f2e324]: runTasks - generic [ref=f2e325]: runTests - generic [ref=f2e326]: problems - generic [ref=f2e327]: changes - generic [ref=f2e328]: usages - generic [ref=f2e329]: findTestFiles - generic [ref=f2e330]: testFailure - generic [ref=f2e331]: terminalLastCommand - generic [ref=f2e332]: terminalSelection - generic [ref=f2e333]: web/fetch - generic [ref=f2e334]: microsoft.docs.mcp - generic [ref=f2e335]: - generic [ref=f2e336]: Last updated - generic [ref=f2e337]: 4 February 2026 - generic [ref=f2e339]: - generic [ref=f2e340]: Source - link "View on GitHub" [ref=f2e342] [cursor=pointer]: - /url: https://github.com/github/awesome-copilot/blob/main/agents/dotnet-upgrade.agent.md - complementary "More like this" [ref=f2e348]: - generic [ref=f2e349]: - generic [ref=f2e350]: Previous - link ".NET Self Learning Architect" [ref=f2e352] [cursor=pointer]: - /url: /agent/dotnet-self-learning-architect/ - generic [ref=f2e355]: - generic [ref=f2e356]: Up next - link "Accessibility Expert" [ref=f2e358] [cursor=pointer]: - /url: /agent/accessibility/ - button - contentinfo [ref=f2e361]: - link "GitHub" [ref=f2e366] [cursor=pointer]: - /url: https://github.com - generic [ref=f2e374]: - generic [ref=f2e375]: - link "Terms" [ref=f2e376] [cursor=pointer]: - /url: https://docs.github.com/site-policy/github-terms/github-terms-of-service - link "Privacy" [ref=f2e377] [cursor=pointer]: - /url: https://docs.github.com/site-policy/privacy-policies/github-general-privacy-statement - link "GitHub Docs" [ref=f2e378] [cursor=pointer]: - /url: https://docs.github.com - link "Community" [ref=f2e379] [cursor=pointer]: - /url: https://github.community - link "Support" [ref=f2e380] [cursor=pointer]: - /url: https://support.github.com - paragraph [ref=f2e381]: © 2026 GitHub. All rights reserved. - generic [ref=f2e384]: - button [ref=f2e385] - button [ref=f2e391] - button [ref=f2e395] - button [ref=f2e400]