Dotnet Upgrade
GitHubOfficialFirst committed by aaronpowellDistributed by GitHub
- Custom agent
- Workflow
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The .NET Upgrade skill provides a structured methodology for migrating C#/.NET projects to newer framework versions. It covers the entire lifecycle of an upgrade, from initial discovery and dependency analysis to execution, testing, and CI/CD pipeline updates. The skill includes specialized prompts for analyzing current target frameworks, generating optimal upgrade sequences, and identifying breaking changes, ensuring a systematic approach to reducing technical debt.
What it does
- Auto-detects current .NET framework versions across solution files.
- Generates prioritized upgrade strategies based on project dependencies.
- Provides step-by-step instructions for modifying project files and updating NuGet packages.
- Offers guidance on modernizing code, such as updating startup logic and replacing deprecated APIs.
- Includes templates for updating CI/CD pipeline configurations for Azure DevOps and GitHub Actions.
- Supplies a validation checklist to ensure successful migration and deployment.
When to use it
- When planning to migrate legacy .NET Framework or older .NET Core projects to a modern LTS version.
- When you need to assess the scope of technical debt related to outdated framework versions.
- When executing a multi-project migration and requiring a safe, sequenced approach.
- When updating build pipelines to support newer .NET SDKs.
Advantages
- Reduces manual effort in identifying and sequencing project upgrades.
- Minimizes risk by prioritizing independent libraries before complex web or API projects.
- Ensures consistency across the repository with standardized upgrade flows.
- Provides clear paths for both code modernization and infrastructure configuration.
Usage examples
- “Analyze the repository and list each project's current TargetFramework along with the latest available LTS version.”
- The agent will scan the codebase, identify all .csproj files, extract the current framework versions, and map them to the latest recommended LTS release.
- “Generate the optimal upgrade order for this repository, prioritizing least-dependent projects first.”
- The agent will analyze project dependencies and provide a sequential list of projects to upgrade, starting with low-level class libraries.
- “List deprecated or incompatible APIs when upgrading from net6.0 to net8.0 for my WebAPI project.”
- The agent will identify known breaking changes and suggest necessary code adjustments for the specified migration path.
- “Create a PR description and checklist for the upgrade of my core library.”
- The agent will generate a structured pull request template including the scope of changes, testing evidence, and a verification checklist.
Install
Download the custom agent as a ZIP:
https://mp-staging.autogineer.com/agent-skills/github/dotnet-upgrade/downloadExtract the agent file into .github/agents, then commit it:
mkdir -p .github/agents && unzip -j dotnet-upgrade.zip 'dotnet-upgrade/dotnet-upgrade.agent.md' -d .github/agentsKeep the LICENSE and ATTRIBUTION.md files from the ZIP with your copy.
Documentation by aaronpowell
.NET Upgrade Collection
.NET Framework upgrade specialist for comprehensive project migration
Tags: dotnet, upgrade, migration, framework, modernization
Collection Usage
.NET Upgrade Chat Mode
Discover and plan your .NET upgrade journey!
---
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.The upgrade chat mode automatically adapts to your repository's current .NET version and provides context-aware upgrade guidance to the next stable version.
It will help you:
Auto-detect current .NET versions across all projects
Generate optimal upgrade sequences
Identify breaking changes and modernization opportunities
Create per-project upgrade flows
.NET Upgrade Instructions
Execute comprehensive .NET framework upgrades with structured guidance!
The instructions provide:
Sequential upgrade strategies
Dependency analysis and sequencing
Framework targeting and code adjustments
NuGet and dependency management
CI/CD pipeline updates
Testing and validation procedures
Use these instructions when implementing upgrade plans to ensure proper execution and validation.
.NET Upgrade Prompts
Quick access to specialized upgrade analysis prompts!
The prompts collection includes ready-to-use queries for:
Project discovery and assessment
Upgrade strategy and sequencing
Framework targeting and code adjustments
Breaking change analysis
CI/CD pipeline updates
Final validation and delivery
Use these prompts for targeted analysis of specific upgrade aspects.
Quick Start
Run a discovery pass to enumerate all
*.slnand*.csprojfiles in the repository.Detect the current .NET version(s) used across projects.
Identify the latest available stable .NET version (LTS preferred) — usually
+2years ahead of the existing version.Generate an upgrade plan to move from current → next stable version (e.g.,
net6.0 → net8.0, ornet7.0 → net9.0).Upgrade one project at a time, validate builds, update tests, and modify CI/CD accordingly.
Auto-Detect Current .NET Version
To automatically detect the current framework versions across the solution:
# 1. Check global SDKs installed
dotnet --list-sdks
# 2. Detect project-level TargetFrameworks
find . -name "*.csproj" -exec grep -H "<TargetFramework" {} \;
# 3. Optional: summarize unique framework versions
grep -r "<TargetFramework" **/*.csproj | sed 's/.*<TargetFramework>//;s/<\/TargetFramework>//' | sort | uniq
# 4. Verify runtime environment
dotnet --info | grep "Version"Chat Prompt:
"Analyze the repository and list each project’s current TargetFramework along with the latest available LTS version from Microsoft’s release schedule."
Discovery & Analysis Commands
# List all projects
dotnet sln list
# Check current target frameworks for each project
grep -H "TargetFramework" **/*.csproj
# Check outdated packages
dotnet list <ProjectName>.csproj package --outdated
# Generate dependency graph
dotnet msbuild <ProjectName>.csproj /t:GenerateRestoreGraphFile /p:RestoreGraphOutputPath=graph.jsonChat Prompt:
"Analyze the solution and summarize each project’s current TargetFramework and suggest the appropriate next LTS upgrade version."
Classification Rules
TargetFrameworkstarts withnetcoreapp,net5.0+,net6.0+, etc. → Modern .NETnetstandard*→ .NET Standard (migrate to current .NET version)net4*→ .NET Framework (migrate via intermediate step to .NET 8+)
Upgrade Sequence
Start with Independent Libraries: Least dependent class libraries first.
Next: Shared components and common utilities.
Then: API, Web, or Function projects.
Finally: Tests, integration points, and pipelines.
Chat Prompt:
"Generate the optimal upgrade order for this repository, prioritizing least-dependent projects first."
Per-Project Upgrade Flow
Create branch:
upgrade/<project>-to-<targetVersion>Edit
<TargetFramework>in.csprojto the suggested version (e.g.,net9.0)Restore & update packages:
dotnet restore dotnet list package --outdated dotnet add package <PackageName> --version <LatestVersion>Build & test:
dotnet build <ProjectName>.csproj dotnet test <ProjectName>.Tests.csprojFix issues — resolve deprecated APIs, adjust configurations, modernize JSON/logging/DI.
Commit & push PR with test evidence and checklist.
Breaking Changes & Modernization
Use
.NET Upgrade Assistantfor initial recommendations.Apply analyzers to detect obsolete APIs.
Replace outdated SDKs (e.g.,
Microsoft.Azure.*→Azure.*).Modernize startup logic (
Startup.cs→Program.cstop-level statements).
Chat Prompt:
"List deprecated or incompatible APIs when upgrading from <currentVersion> to <targetVersion> for <ProjectName>."
CI/CD Configuration Updates
Ensure pipelines use the detected target version dynamically:
Azure DevOps
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '$(TargetDotNetVersion).x'GitHub Actions
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '${{ env.TargetDotNetVersion }}.x'Validation Checklist
[ ] TargetFramework upgraded to next stable version
[ ] All NuGet packages compatible and updated
[ ] Build and test pipelines succeed locally and in CI
[ ] Integration tests pass
[ ] Deployed to a lower environment and verified
Branching & Rollback Strategy
Use feature branches:
upgrade/<project>-to-<targetVersion>Commit frequently and keep changes atomic
If CI fails after merge, revert PR and isolate failing modules
Chat Prompt:
"Suggest a rollback and validation plan if the .NET upgrade for <ProjectName> introduces build or runtime regressions."
Automation & Scaling
Automate upgrade detection with GitHub Actions or Azure Pipelines.
Schedule nightly runs to check for new .NET releases via
dotnet --list-sdks.Use agents to automatically raise PRs for outdated frameworks.
Chatmode Prompt Library
"List all projects with current and recommended .NET versions."
"Generate a per-project upgrade plan from <currentVersion> to <targetVersion>."
"Suggest .csproj and pipeline edits to upgrade <ProjectName>."
"Summarize build/test results post-upgrade for <ProjectName>."
"Create PR description and checklist for the upgrade."
Files
- ATTRIBUTION.mdAdded by AutoGineer876 B
- LICENSELicence file added by AutoGineer1.0 KiB
- dotnet-upgrade.agent.md7.1 KiB
Requirements and compatibility
Written for: GitHub Copilot
Works with: GitHub Copilot
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
aaronpowell
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · agents/dotnet-upgrade.agent.md · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- aaronpowell, specialforest
AutoGineer is not affiliated with or endorsed by aaronpowell or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download dotnet-upgrade.zip