DiagnosticCatalog.Roslyn 1.0.0

dotnet add package DiagnosticCatalog.Roslyn --version 1.0.0
                    
NuGet\Install-Package DiagnosticCatalog.Roslyn -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DiagnosticCatalog.Roslyn" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DiagnosticCatalog.Roslyn" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DiagnosticCatalog.Roslyn" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DiagnosticCatalog.Roslyn --version 1.0.0
                    
#r "nuget: DiagnosticCatalog.Roslyn, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DiagnosticCatalog.Roslyn@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DiagnosticCatalog.Roslyn&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DiagnosticCatalog.Roslyn&version=1.0.0
                    
Install as a Cake Tool

DiagnosticCatalog.Roslyn

🌍 Languages:
πŸ‡¬πŸ‡§ English (this file) | πŸ‡«πŸ‡· FranΓ§ais

The Roslyn analyzer-authoring rules (RS1xxx, RS2xxx) as strongly referenced constants, so that SuppressMessageAttribute takes compile-checked references instead of magic strings.

πŸͺž Mirrors Microsoft.CodeAnalysis.Analyzers 5.6.0

52 rules, 9 categories, every identifier and category read from that release's own analyzers. Regenerated 2026-08-05.

Unofficial. Not affiliated with, endorsed by, or supported by Microsoft.

Why

Nine categories, and two of them break the pattern the other seven follow.

Seven read MicrosoftCodeAnalysis followed by a word: MicrosoftCodeAnalysisCorrectness, MicrosoftCodeAnalysisDesign, MicrosoftCodeAnalysisReleaseTracking. Nobody types those from memory, but at least they are guessable once you have seen one.

Then there is this:

Rule Category
RS1001 Missing diagnostic analyzer attribute MicrosoftCodeAnalysisCorrectness
RS1010 Create code actions should have a unique EquivalenceKey Correctness
RS1011 Use code actions that have a unique EquivalenceKey Correctness
RS1016 Code fix providers should provide FixAll support Correctness
RS1023 Upgrade MSBuildWorkspace Library

The same concept, correctness, spelled two ways in one package β€” twenty rules under the long form and three under the short one, with nothing to tell you which is which. Library is a category with exactly one rule in it.

[SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1016:...", Justification = "…")]   // wrong, and silent

Get the id wrong and the suppression silently does nothing β€” the warning simply stays. Get the category wrong and nothing happens at all, ever: the .NET platform never reads that argument, so no error, no warning and no failing test will tell you.

using DiagnosticCatalog.Roslyn;

[SuppressMessage(
    RoslynRule.RS1016.Category,
    RoslynRule.RS1016.Id,
    Justification = "The fixer is deliberately single-document; FixAll would be wrong here.")]

Who runs these without asking

Microsoft.CodeAnalysis.Analyzers reaches a project transitively, through Microsoft.CodeAnalysis.CSharp. Reference the Roslyn APIs to write an analyzer, a code fix, a source generator or an analyzer test, and these fifty-two rules come with them β€” the same shape as xUnit's and MSTest's analyzers arriving with their test frameworks.

Installation

<PackageReference Include="DiagnosticCatalog.Roslyn" Version="1.0.0" />

That is the only reference you need. This package depends on DiagnosticCatalog, which carries the DCAT analyzers and code fixes beside its attributes, so referencing this catalogue is what switches on the checks that validate rule declarations and their use sites. The assembly doing the reporting is called DiagnosticCatalog.Analyzers.dll, and despite the similar name it is a different thing entirely: it raises this library's own DCAT diagnostics, never Roslyn's RS ones, which are what this catalogue names.

What is in the package

52 rules across 9 categories. Thirteen carry a help link; the rest declare none.

Category Rules What they are about
MicrosoftCodeAnalysisCorrectness 20 Registering actions, analyzer attributes, descriptor construction
MicrosoftCodeAnalysisDesign 10 The shape an analyzer or fixer is expected to have
MicrosoftCodeAnalysisReleaseTracking 9 AnalyzerReleases.Shipped.md and its unshipped twin β€” the RS2xxx range
MicrosoftCodeAnalysisPerformance 4 Work an analyzer should not do per-compilation
Correctness 3 EquivalenceKey and FixAll support β€” the short-form outlier
MicrosoftCodeAnalysisCompatibility 2 Interfaces only Roslyn may implement
MicrosoftCodeAnalysisDocumentation 2 Analyzer documentation
MicrosoftCodeAnalysisLocalization 1 Localizable descriptor arguments
Library 1 RS1023, alone
[DiagnosticRule]
public static class RS1016
{
    public const string Id = nameof(RS1016);
    public const string Category = RoslynCategory.Correctness;
}

Not the RS00xx rules

Three Microsoft packages issue RS rules, and this catalogue holds one of them:

Package Ids Here?
Microsoft.CodeAnalysis.Analyzers RS1xxx, RS2xxx yes, all 52
Microsoft.CodeAnalysis.PublicApiAnalyzers RS0016–RS002x no
Microsoft.CodeAnalysis.BannedApiAnalyzers RS0030, RS0031, RS0035 no

The ids partition cleanly, so there is no ambiguity about which rule lives where. The reason the other two were absent for a while was the icon: three catalogues of RS rules would all have wanted the same two letters, and no icon could tell them apart. That is settled β€” a badge whose prefix is already in service names the catalogue's subject instead, and RS stays here (ADR-0035). Merging them into one catalogue still has no shape in the manifest, which takes one package per catalogue. That is a decision somebody has to make before those 26 rules can be catalogued at all; this package does not pretend to have made it.

Categories declared once

RoslynCategory holds each category once, and the rules reference it β€” so a category's spelling exists in exactly one place, which for MicrosoftCodeAnalysisReleaseTracking is worth more than usual. It is internal by design: a suppression reaches a category through the rule that carries it, RoslynRule.RS1016.Category, and never through the category constant on its own. The two fold to the same string today and stop agreeing the day a rule moves (ADR-0026).

Limits

[SuppressMessage] cannot suppress compiler warnings β€” CS0219 and friends need #pragma warning disable, which takes bare identifiers and so can never reference a constant.

That limit bites harder here than elsewhere, and it is worth being straight about. Several RS rules are reported against a whole assembly or a project file rather than a syntax node β€” RS1036 Specify EnforceExtendedAnalyzerRules, RS1038 Compiler extensions should target netstandard2.0, RS2008 Enable analyzer release tracking β€” and the usual answer to those is #pragma or an .editorconfig entry, neither of which can take a constant. This repository silences three of them that way in its own tests. Where [SuppressMessage] does apply, the constants here work; where it does not, no catalogue can help.

How it is produced

Not transcribed from documentation. The generator reads the analyzer assemblies' metadata for the types they mark with [DiagnosticAnalyzer], constructs those, and reads the DiagnosticDescriptor instances they actually declare β€” the only source that cannot have drifted, which is what surfaced the two off-pattern categories above.

dotnet run --project src/DiagnosticCatalog.Cli -- generate \
    --package Microsoft.CodeAnalysis.Analyzers --package-version latest \
    --namespace DiagnosticCatalog.Roslyn --container RoslynRule \
    --output src/DiagnosticCatalog.Roslyn/RoslynRules.g.cs

How it stays current

A nightly workflow regenerates every catalogue from its upstream package and opens a pull request when anything the catalogue publishes has moved. It never publishes: a category or an id that changed upstream changes a published contract, and since the platform never reads a suppression's category, a wrong value merged unreviewed would produce no symptom anywhere. A human reads the diff.

A rule retired upstream is never deleted. It is kept and marked [Obsolete] naming the version that dropped it, so a project still referencing it gets a CS0618 warning telling it to remove the suppression β€” rather than a hard error from a member that vanished. Consumers inline constant values at their own compile time, so deleting one breaks their recompilation.

How it reaches nuget.org

This catalogue rides the roslyn release train and versions independently of the foundation, so it can follow Microsoft.CodeAnalysis.Analyzers' releases without dragging anything else along.

Publishing is not part of the nightly. A maintainer pushes a roslyn-vX.Y.Z tag, and the release workflow packs the package, embeds an SPDX SBOM, and publishes through NuGet Trusted Publishing with signed build provenance β€” no long-lived API key exists anywhere to leak.

See also

Every catalogue this repository publishes is listed in one place β€” pick the one that matches an analyzer you run:

The ready-made catalogues

Want a catalogue of your own? Your analyzer's rules, or an internal ruleset, are declared exactly the way these are: a static class of constants marked [DiagnosticRule], referenced by consumers instead of retyped. That marker ships in DiagnosticCatalog, the foundation this catalogue is built on, and its README is the guide.

Documentation

For using a catalogue, in the order the work happens:

  • Getting started β€” ten minutes: reference this package, rewrite one suppression, break it on purpose and watch the compiler catch it.
  • Writing suppressions that the compiler checks β€” the full version, including migrating the literals you already have.
  • Publishing a catalogue β€” the structural contract, and how to ship one for your own analyzer's rules.
  • Configuration β€” every severity key, the category-wide switch, and the PrivateAssets mistake that silences everything.
  • Troubleshooting β€” by symptom: nothing is reported, CS0117, CS0618 after an upgrade.

The documentation map picks a page by what you are trying to do; every guide exists in English and French. The specification is the normative version of all of it.

License

Apache-2.0. The rule identifiers, categories, titles and help links are read from a Microsoft analyzer, which is itself MIT-licensed.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 172 8/7/2026