# How to use GitHub Copilot to clean .NET conditionals

Copilot removed obsolete .NET version conditionals using file-specific rules, preserving Framework and Standard branches as maintainers reviewed the cleanup.

Agent: GitHub Copilot (via Copilot coding agent)
Tools: GitHub Copilot, .NET, Git, GitHub
Category: Software & DevOps
Date: 2026-01-07

Outcome: Copilot removed obsolete .NET version conditionals using file-specific rules, preserving Framework and Standard branches as maintainers reviewed the cleanup; the pull request merged into dotnet/runtime main.

## Steps

1. Distinguished runtime-only from multi-targeted files.
2. Replaced obsolete version constants with NET where needed.
3. Removed unconditional branches and refreshed tests/baselines.

Human oversight: Human provided transformation strategy and reviewed/merged.

Source: [Copilot (on behalf of stephentoub) on GitHub](https://github.com/dotnet/runtime/pull/122953)

Canonical URL: https://agentsinuse.com/use-cases/github-copilot-to-clean-net-conditionals/
