dotnet-code-analysis

Configure .NET SDK analyzers via Directory.Build.props and .editorconfig.

8|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills --skill dotnet-code-analysis-postpartum-genushyacinthus29
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-code-analysis
Source: https://github.com/Postpartum-genushyacinthus29/dotnet-skills/tree/main/skills/dotnet-code-analysis
Command: npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills --skill dotnet-code-analysis-postpartum-genushyacinthus29

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams consistently apply and enforce built-in .NET SDK analyzers across repositories to catch and prevent code-quality regressions before they reach production.

Core Features & Use Cases

  • Enable and manage first-party analyzers across projects with EnableNETAnalyzers and AnalysisLevel.
  • Define and enforce warning policies via Directory.Build.props and .editorconfig for gradual or immediate policy application.
  • Use guidance tailored for new vs legacy projects to achieve predictable CI outcomes and higher code quality.

Quick Start

Run a baseline setup by turning on built-in analyzers in Directory.Build.props and set AnalysisLevel to latest-recommended, then run dotnet build to surface analyzer warnings and iterate.

Frequently Asked Questions about dotnet-code-analysis

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

FAQPage Schema
How do I enforce .NET code analysis in CI workflows?

Enforce .NET code analysis in CI by enabling built-in SDK analyzers using EnableNETAnalyzers and setting AnalysisLevel in Directory.Build.props, then running dotnet build to surface warnings as guardrails.

What is the best way to enable Roslyn analyzers for legacy .NET projects?

Enable Roslyn analyzers for legacy .NET projects by applying a gradual promotion strategy, configuring AnalysisLevel and warning policies in Directory.Build.props and .editorconfig to achieve predictable CI outcomes.

How do I configure AnalysisLevel and warning policies in .editorconfig?

Configure AnalysisLevel and warning policies in .editorconfig and Directory.Build.props to define whether analyzer violations are treated as errors or warnings, supporting both immediate and gradual policy application.

Can I use built-in .NET SDK analyzers for both new and legacy projects?

Built-in .NET SDK analyzers apply to both new and legacy projects, providing tailored guidance for configurability of EnableNETAnalyzers and warning policies to satisfy CI guardrails and support gradual promotion.

Why does dotnet build not show code analysis warnings after enabling analyzers?

Dotnet build fails to show code analysis warnings when EnableNETAnalyzers is not set or AnalysisLevel is misconfigured in Directory.Build.props, preventing built-in .NET SDK analyzers from surfacing violations during compilation.