mcaf-dotnet-code-analysis

Configure .NET SDK analyzers and warning policies in MSBuild.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures that .NET repositories leverage built-in code analysis tools to improve code quality and enforce coding standards directly within the build process.

Core Features & Use Cases

  • First-Party Analysis: Integrates and enables the free, built-in .NET SDK analyzers.
  • CI Enforcement: Configures build processes to fail on analyzer warnings, ensuring code quality gates are met.
  • Guidance: Provides clarity on setting EnableNETAnalyzers, AnalysisLevel, and warning policies.
  • Use Case: A development team wants to ensure all new .NET code adheres to best practices and catches potential bugs early. This Skill helps them configure the project to automatically run these checks during builds.

Quick Start

Enable built-in .NET analyzers and configure warnings to be treated as errors in this repository.

Frequently Asked Questions about mcaf-dotnet-code-analysis

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

FAQPage Schema
How do I enable .NET SDK code analysis in MSBuild?

To enable .NET SDK code analysis, configure your MSBuild project to activate built-in analyzers by setting EnableNETAnalyzers and defining an AnalysisLevel. This ensures code quality checks run during standard builds.

How do I configure .editorconfig to set .NET analyzer rule severity?

You can configure .editorconfig files to set specific rule-level severities for .NET SDK analyzers. This integrates seamlessly with MSBuild, allowing granular control over which code analysis warnings or errors apply to your repository.

What is the AnalysisLevel setting in .NET code analysis?

The AnalysisLevel setting in .NET code analysis determines the aggressiveness of the built-in SDK analyzers. Configuring this property in MSBuild allows you to scale the strictness of coding standard checks from minimum to comprehensive.

Why does my CI build fail when enabling .NET SDK analyzers?

Your CI build fails when enabling .NET SDK analyzers because warning policies are configured to treat analyzer warnings as errors. This enforcement mechanism ensures that code quality gates are met before changes are merged.

Does the .NET code analysis Skill work with AGENTS.md?

Yes, the .NET code analysis configuration supports integration with AGENTS.md. This allows development teams to document and enforce analyzer settings and warning policies alongside their standard build processes.