NetAgents.Analyzers 26.10.19.3743

dotnet add package NetAgents.Analyzers --version 26.10.19.3743
                    
NuGet\Install-Package NetAgents.Analyzers -Version 26.10.19.3743
                    
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="NetAgents.Analyzers" Version="26.10.19.3743">
  <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="NetAgents.Analyzers" Version="26.10.19.3743" />
                    
Directory.Packages.props
<PackageReference Include="NetAgents.Analyzers">
  <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 NetAgents.Analyzers --version 26.10.19.3743
                    
#r "nuget: NetAgents.Analyzers, 26.10.19.3743"
                    
#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 NetAgents.Analyzers@26.10.19.3743
                    
#: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=NetAgents.Analyzers&version=26.10.19.3743
                    
Install as a Cake Addin
#tool nuget:?package=NetAgents.Analyzers&version=26.10.19.3743
                    
Install as a Cake Tool

โœจ NetAgents

NuGet

Consistent C# standards, enforced on every build.

Keep formatting, naming, and code quality consistent across your .NET projects. NetAgents automatically formats your source files and applies available code fixes when you build.

๐Ÿ“ฆ Install

dotnet add package NetAgents.Analyzers

Requires the .NET 10 SDK or newer. Your projects can target older .NET versions.

Set PrivateAssets="all" on the package reference to keep the dependency private to your project. Shared rules apply automatically.

๐Ÿ› ๏ธ Build and format

dotnet build

On each build, NetAgents:

  1. Formats your source files and applies available code fixes automatically.
  2. Checks the updated code against the shared rules.
  3. Reports any remaining violations as build errors for you to resolve.

Builds can change your source files. Every rewritten file is named in the build log, including when the build then fails on a violation no fix can repair. A build that would leave behind a violation it introduced changes nothing at all and says so instead. Review those changes before committing. Some violations require a manual fix; IDE quick fixes and dotnet format are also available.

Unchanged builds reuse completed formatting after checking a content fingerprint of the sources, dependencies, tools, and configuration. Policy checks and compiler enforcement remain enabled. Profile a build with dotnet-trace; dotnet clean discards the record when a full run is wanted.

๐Ÿ“ Formatting rules

  • Conditions: keep conditions on one line, with at most 128 characters. Extract longer expressions into separate variables. Ternary conditions follow this rule; their ? and : branches can span multiple lines.
  • Arguments and parameters: keep lists on one line when their normalized contents fit within 128 characters, excluding the surrounding delimiters. Longer lists put each item and the closing delimiter on separate lines, and so does a list holding a lambda with several statements, one statement per line. This applies to calls and declarations, including constructors and records.
  • Layout: use consistent spacing, blank lines between methods and around control flow and multiline declarations, braces based on body layout, and a final newline.
  • Clarity: name literal arguments, pass every other argument positionally, and remove unused imports.

๐Ÿ—‚๏ธ Member order

Members are sorted by kind, visibility, const/static/instance, readonly, then name. Nested classes follow methods. Overloads with matching sorting keys retain their relative order.

Sorting preserves initializer order and storage order in structs and types with explicit layout. Types containing preprocessor directives retain their member order.

โœ… Code standards

Area What to expect
๐Ÿงฉ Type safety Nullable analysis is required. No boxing, object/dynamic values, or untyped collections.
๐Ÿ—๏ธ Design Return dedicated named records, classes, or structs instead of tuple result types, including wrapped tuple results. Lambdas with one inferred parameter drop the optional parentheses.
๐Ÿท๏ธ Naming and structure Descriptive names, imported type names instead of qualified ones, one top-level type per matching file, files under 1,000 lines, and at most 16 authored C# files per directory.
๐Ÿ“ Documentation One <summary> per documentation comment; describe parameters, results, and detail with <param>, <returns>, and <remarks>.
๐Ÿ›ก๏ธ Reliability Consume return values. No discarded results, empty catches, null-forgiving operators, or unconditional loops.
โšก Concurrency Use asynchronous composition or Nito.AsyncEx for coordination. No lock, framework synchronization primitives, or blocking waits.
๐Ÿ“– Documentation XML comments are required for public APIs.

C# written in Razor components and views (@code, @functions, and @{ } blocks, and event-handler lambdas) meets the type-safety, descriptive-name, reliability, concurrency, and tuple-result rules too. Formatting rules and fixes apply to .cs files.

Existing editor and project settings must agree with the shared rules. See the complete rule reference for details.


๐Ÿ“ฆ NuGet package ยท ๐Ÿ“– Rule reference ยท โš–๏ธ MIT license

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
26.10.19.3743 3,340 10/19/2026
26.10.18.2767 855 10/18/2026
26.10.18.2573 80 10/18/2026
26.10.17.9658 281 10/17/2026
26.10.16.1606 564 10/16/2026
26.10.15.8906 227 10/15/2026
26.10.15.7960 187 10/15/2026
26.10.14.2788 353 10/14/2026
26.10.14.2527 82 10/14/2026
26.10.14.2358 94 10/14/2026
26.10.14.2282 80 10/14/2026
26.10.14.1705 138 10/14/2026
26.10.14.1499 75 10/14/2026
26.10.13.9263 245 10/13/2026
26.10.13.8829 129 10/13/2026
26.10.13.8484 208 10/13/2026
26.10.13.8288 100 10/13/2026
26.10.13.7973 78 10/13/2026
26.10.12.1864 1,175 10/12/2026
26.10.9.9207 619 10/9/2026
Loading failed