dotnet-code-analysis

Configure .NET projects with Roslyn analyzers and .editorconfig rules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps ensure code quality and consistency in .NET projects by configuring and enforcing built-in Roslyn analyzers and code style rules.

Core Features & Use Cases

  • Automated Code Analysis: Integrates .NET SDK analyzers into the build process.
  • Warning Promotion: Configures build to treat specific warnings as errors, improving code quality over time.
  • Use Case: A team wants to ensure all new .NET code adheres to security best practices and fails the build if critical warnings are detected.

Quick Start

Configure the current .NET repository to use built-in analyzers and treat all warnings as errors.

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 quality standards using Roslyn analyzers?

You can enforce .NET code quality by configuring Roslyn analyzers through MSBuild properties and .editorconfig files to define analysis levels, severity, and specific rule enforcements during the build process.

How do I configure a .NET build to treat warnings as errors?

To treat .NET warnings as errors, you can apply warning promotion strategies within your MSBuild configuration, ensuring the build fails if critical code quality or security warnings are detected.

What is the best way to automate code analysis in a .NET CI pipeline?

Automating .NET code analysis in CI involves integrating .NET SDK analyzers into the build process, managing analyzer configurations, and enforcing code style settings across the repository to improve maintainability.

Can I manage .NET analyzer severity levels using .editorconfig files?

Yes, you can manage .NET analyzer severity levels and specific rule enforcements using .editorconfig files, which integrate directly with MSBuild properties to define analysis levels for your repository.

Why should I use built-in .NET SDK analyzers instead of external code analysis tools?

Built-in .NET SDK analyzers provide build-time analysis natively through Roslyn, allowing you to enforce code quality and security standards without adding external dependencies or complex tool integrations.

Does .NET code analysis work without adding external dependencies to my project?

Yes, .NET code analysis works by utilizing the built-in Roslyn analyzers provided by the .NET SDK, allowing you to enforce code style and quality without installing external analyzer dependencies.