Muonroi.CodeStandards 2.0.2

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

Muonroi.CodeStandards

NuGet Status NuGet Download

Roslyn analyzers ensuring strict adherence to the Muonroi coding guidelines.

Overview

Provides a suite of Roslyn-based analyzers and code fixes, such as Mstd0001_ForbiddenThrowAnalyzer, Mstd0002_NullForgivingAnalyzer, and Mstd0003_LoggingViaMLogAnalyzer.

Features

  • Strict Exception Handling: Mstd0001_ForbiddenThrowAnalyzer ensures proper exception types are thrown.
  • Null Safety: Mstd0002_NullForgivingAnalyzer and Mstd0002_NullForgivingCodeFix limit the use of the null-forgiving operator (!).
  • Logging Standards: Mstd0003_LoggingViaMLogAnalyzer enforces logging through the standard MLog structure.
  • Guard Rails: Mstd0004_DirectMGuardBypassAnalyzer ensures MGuard is used appropriately.

Installation

dotnet add package Muonroi.CodeStandards

Quick Start


<PackageReference Include="Muonroi.CodeStandards" Version="1.0.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

Ecosystem Combinations

  • With Muonroi.Core: Enforces the usage of MGuard instead of standard exceptions when developing core services.
  • Full Stack Example:
// The analyzer will flag this if standard throw is used instead of MGuard
// throw new Exception("Error"); -> MGuard.NotNull(value, nameof(value));

Samples

Check out the Samples directory for full examples.

License

MIT

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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
2.0.2 98 8/26/2026
2.0.1 105 8/26/2026
2.0.0 121 8/14/2026