ExxerRules 1.0.3

dotnet add package ExxerRules --version 1.0.3
                    
NuGet\Install-Package ExxerRules -Version 1.0.3
                    
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="ExxerRules" Version="1.0.3">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExxerRules" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="ExxerRules">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 ExxerRules --version 1.0.3
                    
#r "nuget: ExxerRules, 1.0.3"
                    
#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 ExxerRules@1.0.3
                    
#: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=ExxerRules&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=ExxerRules&version=1.0.3
                    
Install as a Cake Tool

ExxerRules - Modern Development Conventions

NuGet Downloads MIT License

ExxerRules is a comprehensive suite of 20 production-ready Roslyn analyzers that enforce Modern Development Conventions (MDC) for C# projects. No IDE extensions required - works everywhere .NET works.

๐Ÿš€ Quick Start

Installation

# Package Manager Console
Install-Package ExxerRules

# .NET CLI
dotnet add package ExxerRules

# PackageReference
<PackageReference Include="ExxerRules" Version="1.0.0" PrivateAssets="all" />

Zero Configuration

Works out-of-the-box! The analyzers activate automatically and start improving your code quality immediately.

๐Ÿ“ฆ What's Included

๐Ÿ—๏ธ Architecture (2 analyzers)

  • ER1001: Domain Should Not Reference Infrastructure
  • ER1002: Use Repository Pattern

โšก Async Best Practices (2 analyzers)

  • ER2001: Async Methods Should Accept CancellationToken
  • ER2002: Use ConfigureAwait(false)

๐Ÿ›ก๏ธ Error Handling (2 analyzers)

  • ER6001: Avoid Throwing Exceptions
  • ER6002: Use Result<T> Pattern

๐Ÿงช Modern Testing (5 analyzers)

  • ER12001: Do Not Mock DbContext
  • ER12002: Do Not Use FluentAssertions (use Shouldly)
  • ER12003: Do Not Use Moq (use NSubstitute)
  • ER12004: Test Naming Convention
  • ER12005: Use xUnit v3

โšก Performance (1 analyzer)

  • ER11001: Use Efficient LINQ

โœจ Modern C# (2 analyzers)

  • ER9001: Use Expression-Bodied Members
  • ER9002: Use Modern Pattern Matching

๐Ÿ’Ž Code Quality (2 analyzers)

  • ER4001: Avoid Magic Numbers and Strings
  • ER4002: Do Not Use Regions

๐Ÿ“š Documentation (1 analyzer)

  • ER5001: Public Members Should Have XML Documentation

๐Ÿ“Š Logging (2 analyzers)

  • ER8001: Do Not Use Console.WriteLine
  • ER8002: Use Structured Logging

๐Ÿ›ก๏ธ Null Safety (1 analyzer)

  • ER10001: Validate Null Parameters

๐Ÿ”„ Functional Patterns (1 analyzer)

  • ER7001: Do Not Throw Exceptions in Functional Code

๐ŸŽจ Code Formatting (2 analyzers)

  • ER3001: Code Formatting Standards
  • ER3002: Project Formatting Standards

โš™๏ธ Configuration

Basic Configuration

Add to your .csproj file:

<PropertyGroup>
  
  <ExxerRulesEnabled>true</ExxerRulesEnabled>
  
  
  <ExxerRulesSeverity>warning</ExxerRulesSeverity>
</PropertyGroup>

Advanced Configuration

Enable/disable specific categories:

<PropertyGroup>
  <ExxerRulesArchitecture>true</ExxerRulesArchitecture>
  <ExxerRulesAsync>true</ExxerRulesAsync>
  <ExxerRulesErrorHandling>true</ExxerRulesErrorHandling>
  <ExxerRulesTesting>true</ExxerRulesTesting>
  <ExxerRulesPerformance>true</ExxerRulesPerformance>
  <ExxerRulesModernCSharp>true</ExxerRulesModernCSharp>
  <ExxerRulesCodeQuality>true</ExxerRulesCodeQuality>
  <ExxerRulesDocumentation>false</ExxerRulesDocumentation>
  <ExxerRulesLogging>true</ExxerRulesLogging>
  <ExxerRulesNullSafety>true</ExxerRulesNullSafety>
  <ExxerRulesFunctionalPatterns>true</ExxerRulesFunctionalPatterns>
  <ExxerRulesCodeFormatting>true</ExxerRulesCodeFormatting>
</PropertyGroup>

Directory.Build.props Integration

Apply to all projects in your solution:


<Project>
  <PropertyGroup>
    <ExxerRulesEnabled>true</ExxerRulesEnabled>
    <ExxerRulesSeverity>warning</ExxerRulesSeverity>
    
    <ExxerRulesDocumentation Condition="$(MSBuildProjectName.Contains('Test'))">false</ExxerRulesDocumentation>
  </PropertyGroup>
</Project>

๐ŸŽฏ Modern Development Conventions

  • Result<T> for error handling instead of exceptions
  • Repository Pattern for data access abstraction
  • xUnit v3 with NSubstitute and Shouldly for testing
  • CancellationToken for async operations
  • ConfigureAwait(false) for library code
  • Structured logging with ILogger<T>

โŒ Anti-Patterns Detected

  • Exception throwing for control flow
  • Direct infrastructure references from domain
  • Magic numbers and strings
  • Console.WriteLine for logging
  • Legacy test frameworks (MSTest, NUnit)
  • FluentAssertions and Moq (replaced by better alternatives)

๐Ÿ› ๏ธ CI/CD Integration

Works seamlessly in build pipelines:

# Azure DevOps
- task: DotNetCoreCLI@2
  displayName: 'Build with ExxerRules'
  inputs:
    command: 'build'
    projects: '**/*.csproj'
    arguments: '--configuration Release --verbosity normal'

# GitHub Actions
- name: Build with ExxerRules
  run: dotnet build --configuration Release --verbosity normal

๐Ÿ“‹ Requirements

  • .NET Standard 2.0 or higher
  • C# 7.0 or higher
  • Works with:
    • Visual Studio 2019/2022
    • Visual Studio Code (with C# extension)
    • JetBrains Rider
    • Command line builds
    • CI/CD systems

๐ŸŒŸ Benefits

  • Zero Setup - Install and go
  • Consistent Quality - Same rules across team and CI/CD
  • Gradual Adoption - Enable categories incrementally
  • Performance - Fast analysis with minimal impact
  • Modern Standards - Based on current C# best practices
  • Open Source - MIT licensed, community driven

๐Ÿ“„ License

Licensed under the MIT License.


Built with โค๏ธ by the ExxerAI Team

Making C# development more reliable, maintainable, and performant - everywhere.

There are no supported framework assets in this package.

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
1.0.3 82 8/15/2025
1.0.2 102 8/9/2025