DiagnosticCatalog.Self 1.0.1

dotnet add package DiagnosticCatalog.Self --version 1.0.1
                    
NuGet\Install-Package DiagnosticCatalog.Self -Version 1.0.1
                    
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.Self" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DiagnosticCatalog.Self" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="DiagnosticCatalog.Self" />
                    
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.Self --version 1.0.1
                    
#r "nuget: DiagnosticCatalog.Self, 1.0.1"
                    
#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.Self@1.0.1
                    
#: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.Self&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=DiagnosticCatalog.Self&version=1.0.1
                    
Install as a Cake Tool

DiagnosticCatalog.Self

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

The DCAT rules β€” the ones the analyzers inside DiagnosticCatalog report β€” as constants you can reference.

It is the library applied to itself. The analyzers that check your suppressions publish their own rules the same way they ask everybody else to, and they do it through the same generator that produces the Sonar, .NET-analyzers and StyleCop catalogues.

When you want it

When you suppress a DCAT diagnostic and would rather the suppression be checked:

using System.Diagnostics.CodeAnalysis;
using DiagnosticCatalog.Self;

// Migrating a large codebase: this file is done last, and the literals here are deliberate.
[SuppressMessage(
    DcatRule.DCAT0006.Category,
    DcatRule.DCAT0006.Id,
    Justification = "Legacy suppressions, migrated in the next pass.")]
public static class LegacyInterop
{
}

Without the catalogue you would write [SuppressMessage("DiagnosticCatalog", "DCAT0006")] β€” two strings nothing checks, which is the exact problem this repository exists to remove. It would have been odd to leave our own rules as the one place you still had to write them by hand.

Most projects will not need this: .editorconfig is the usual way to turn a DCAT diagnostic down, and it takes plain text that no constant can ever be substituted into. Reach for the catalogue when you are suppressing at a specific site, for a reason worth writing down.

Where it comes from

Generated from the analyzers' own DiagnosticDescriptor instances, never from documentation, so the id and the category are the values the analyzer actually reports. Regenerating it is one command:

dotnet run --project src/DiagnosticCatalog.Cli -- generate --manifest eng/catalogs.json

CI regenerates it on every pull request and fails if the result differs from what is committed β€” so a new DCAT id cannot ship without the catalogue that publishes it.

Versioning

This catalogue rides the lib train, with the analyzers it mirrors, and that is deliberate: the two are generated from one source in one repository and must never describe different rule sets. The other eleven catalogues version independently because an outside vendor sets their pace (ADR-0015); nobody outside sets this one's.

A retired rule is carried forward as [Obsolete] rather than deleted, like everywhere else here: constants are inlined into your assembly at your compile time, so removing one breaks your build with a message that names nothing useful.

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

The documentation map picks a page by what you are trying to do; every guide exists in English and French.

Licence

Apache-2.0.

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.1 6 8/7/2026