ModulusKit.Analyzers
4.0.0
dotnet add package ModulusKit.Analyzers --version 4.0.0
NuGet\Install-Package ModulusKit.Analyzers -Version 4.0.0
<PackageReference Include="ModulusKit.Analyzers" Version="4.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="ModulusKit.Analyzers" Version="4.0.0" />
<PackageReference Include="ModulusKit.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add ModulusKit.Analyzers --version 4.0.0
#r "nuget: ModulusKit.Analyzers, 4.0.0"
#:package ModulusKit.Analyzers@4.0.0
#addin nuget:?package=ModulusKit.Analyzers&version=4.0.0
#tool nuget:?package=ModulusKit.Analyzers&version=4.0.0
ModulusKit.Analyzers
Roslyn analyzers and code fixes for enforcing Modulus modular architecture conventions directly in your IDE.
Installation
dotnet add package ModulusKit.Analyzers
Or as an analyzer reference in your .csproj:
<PackageReference Include="ModulusKit.Analyzers"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
Note: This is a development-dependency (analyzer) package -- it does not flow transitively through other
ModulusKit.*packages or through project references. Add the reference above to each project where the MOD rules should run. Solutions scaffolded by themodulusCLI have this wired up already.
Rules
| Rule | Severity | Description | Code Fix |
|---|---|---|---|
| MOD001 | Error | Module boundary violation -- cross-module reference to non-Integration project | -- |
| MOD002 | Warning | Handler not returning Result or Result<T> |
-- |
| MOD003 | Warning | Throwing exceptions for expected errors in handlers instead of returning Error |
Yes |
| MOD004 | Warning | Infrastructure attributes (EF, JSON) in Domain layer | Yes |
| MOD005 | Info | Public setter on entity property | Yes |
Configuration
Adjust severities in .editorconfig:
[*.cs]
dotnet_diagnostic.MOD001.severity = error
dotnet_diagnostic.MOD002.severity = warning
dotnet_diagnostic.MOD003.severity = warning
dotnet_diagnostic.MOD004.severity = warning
dotnet_diagnostic.MOD005.severity = suggestion
Suppress individual occurrences with #pragma:
#pragma warning disable MOD001
using EShop.Catalog.Domain.Products;
#pragma warning restore MOD001
Learn More
See the Modulus documentation for full rule reference with examples.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- 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 |
|---|---|---|
| 4.0.0 | 94 | 7/26/2026 |
| 3.1.0 | 293 | 7/26/2026 |
| 3.0.0 | 231 | 7/26/2026 |
| 2.1.0 | 205 | 7/4/2026 |
| 2.0.0 | 108 | 7/3/2026 |
| 1.2.5 | 124 | 3/15/2026 |
| 1.2.4 | 113 | 3/15/2026 |
| 1.2.3 | 112 | 3/14/2026 |
| 1.2.2 | 111 | 3/14/2026 |
| 1.2.1 | 116 | 3/14/2026 |
| 1.2.0 | 118 | 3/14/2026 |
| 1.1.1 | 115 | 3/8/2026 |
| 1.1.0 | 115 | 3/5/2026 |
| 1.0.1 | 118 | 3/5/2026 |