migrating-csharp-nullable-references

Enable nullable reference types and resolve CS86xx warnings in C# projects.

19|2|Updated May 13, 2026
One-click install
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-csharp-nullable-references
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-csharp-nullable-references
Source: https://github.com/microsoft/upgrade-agent-plugins/tree/main/plugins/upgrade-agent/extenders/upgrade-dotnet/upgrade/skills/lazy/common/migrating-csharp-nullable-references
Command: npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-csharp-nullable-references

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires powershell, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill assists in enabling nullable reference types (NRTs) in C# projects and resolving associated warnings, ensuring null safety without compromising runtime behavior.

Core Features & Use Cases

  • Nullable Reference Type Enablement: Systematically enable NRTs in a C# project or solution, including handling project-specific settings and configurations.
  • Warning Resolution: Address and resolve CS86xx warnings related to nullable reference types, including dereference warnings and nullability annotations.
  • Rollout Strategy: Offers guidance on rollout strategies for different project sizes and activity levels, including project-wide, warnings-first, and file-by-file approaches.
  • Build and Test Integration: Provides integration with build and test commands to ensure migration does not affect existing functionality.

Quick Start

Run the migration on your C# project using the following command:

/path/to/project -enable-nullable

Frequently Asked Questions about migrating-csharp-nullable-references

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable nullable reference types in a C# project?

To enable nullable reference types in a C# project, you can run the migration command targeting your project path. This process systematically updates project-specific settings and configurations to activate null safety features.

What is the best way to resolve CS86xx warnings during a nullable reference type migration?

Resolving CS86xx warnings involves addressing dereference warnings and updating nullability annotations. The migration process systematically fixes these nullable reference type warnings without compromising existing runtime behavior.

Do I need PowerShell to migrate my C# project to nullable reference types?

Yes, PowerShell is required to execute the migration scripts. The Skill relies on PowerShell to automate enabling nullable reference types and integrating build and test commands.

What rollout strategies are available for enabling nullable reference types?

Available rollout strategies include project-wide, warnings-first, and file-by-file approaches. These options accommodate different C# project sizes and activity levels to ensure a smooth migration.

Will enabling nullable reference types break my existing C# project tests?

No, the migration includes build and test integration to ensure enabling nullable reference types does not affect existing functionality. It addresses null safety while maintaining current runtime behavior.

Can I enable nullable reference types for specific files instead of the whole C# project?

Yes, you can use a file-by-file rollout strategy. This approach allows you to gradually enable nullable reference types and resolve warnings in targeted sections of your C# project.