NetEvolve.Analyzer 0.14.9

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

NetEvolve.Analyzer

NuGet Version NuGet Downloads License

Roslyn analyzers and code fixes for .NET, organized by the standard Microsoft diagnostic categories. It enforces consistent file organization and safer null-check idioms in C# code, with an automatic fix offered for every rule that has one.

Features

  • File organization - one type per file, namespace matches folder structure, single namespace per file
  • Null-check idioms - is null / is not null patterns instead of == null, != null, or is object
  • Code fixes - a fix is registered for every rule, gated to the language version it requires
  • Batch fixes - a shared sequential Fix-All provider applies fixes across a document, project, or solution
  • Configurable - MSBuild properties tune or fully disable the file-organization rules
  • Zero footprint - a development dependency only; no runtime assembly is added to your project

Installation

NuGet Package Manager

Install-Package NetEvolve.Analyzer

.NET CLI

dotnet add package NetEvolve.Analyzer

PackageReference

<PackageReference Include="NetEvolve.Analyzer" Version="x.x.x" PrivateAssets="all" />

The package ships the analyzer assembly built separately against four Roslyn API versions (see Supported Roslyn versions) and adds no runtime dependencies to your project; PrivateAssets="all" keeps it from flowing to your own package consumers.

Quick Start

No code changes are required. Once the package reference is added, the analyzers run on every build and report diagnostics under the NE prefix, for example:

warning NE0004: Use the 'is null' pattern instead of '== null'

Apply the offered code fix in your editor, or fix every occurrence at once with dotnet format:

dotnet format analyzers --diagnostics NE0004

Usage

Basic example

Given:

if (value == null)
{
    return;
}

NE0004 reports the comparison and offers a code fix that rewrites it to:

if (value is null)
{
    return;
}

File organization example

NE0001 and NE0002 keep a file's name and namespace aligned with its type and folder. A file at Shapes/Circle.cs declaring namespace Geometry.Polygons; is flagged by NE0002 with a fix that rewrites the namespace to Geometry.Shapes (the folder-derived value, anchored at RootNamespace).

Configuration

All configuration is done through standard MSBuild properties in your project file — no .editorconfig entries are required.

<PropertyGroup>
  
  <NetEvolveAnalyzerGroupGenericOverloads>true</NetEvolveAnalyzerGroupGenericOverloads>

  
  <NetEvolveAnalyzerDisableFileOrganizationRules>true</NetEvolveAnalyzerDisableFileOrganizationRules>
</PropertyGroup>

The file-organization rules are also disabled automatically for single-file deployments (PublishSingleFile=true).

To suppress an individual diagnostic instead:

#pragma warning disable NE0001
#pragma warning restore NE0001

Diagnostics

Every rule uses the NE identifier prefix and is documented under docs/rules, with its cause, rule description, fix guidance, and configuration options.

Rule Category Description Code fix
NE0001 Maintainability Declare one type per file with a matching file name Yes
NE0002 Maintainability Namespace should match the folder structure Yes
NE0003 Maintainability Declare a single namespace per file Yes
NE0004 Usage Use the is null pattern instead of == null Yes
NE0005 Usage Use the is not null pattern instead of != null Yes
NE0006 Usage Use the is not null pattern instead of is object Yes
NE0007 Documentation Use <see langword="..."/> instead of <c>...</c> or <code>...</code> for C# keywords Yes
NE0008 Documentation Use <see cref="..."/> instead of <c>...</c> or <code>...</code> for native type names Yes
NE0009 Usage Check for cancellation at the start of a method with a CancellationToken parameter Yes
NE0010 Usage Accept a CancellationToken parameter on a Task/ValueTask/IAsyncEnumerable-returning method Yes
NE0011 Style Avoid #region directives Yes

A DiagnosticSuppressor (NES0001) also ships alongside NE0007: it suppresses Meziantou.Analyzer's MA0154 wherever NE0007 already reports the same location, so a consumer running both analyzers doesn't get the same violation twice — see docs/rules/NE0007.md.

See AnalyzerReleases.Shipped.md for the list of rules included in the current release, and AnalyzerReleases.Unshipped.md for rules staged for the next one.

Requirements

  • A project compiling with a Roslyn-based compiler (any currently supported .NET SDK)
  • No target-framework restriction on the consuming project — the analyzer runs against the compiler, not your project's target framework

Supported Roslyn versions

The analyzer's source is built separately against four Roslyn API (Microsoft.CodeAnalysis.CSharp) versions — 4.4.0, 4.7.0, 4.14.0, and the latest, 5.6.0 — each packed into its own analyzers/dotnet/roslynX.Y/cs folder. .NET SDKs from 8.0.400 onward select the highest version they support automatically; you don't need to configure anything.

SDKs that predate this selection feature don't load any analyzer build from this package (rather than an incorrect or duplicated one) — in practice this only affects unpatched, out-of-support SDKs, since the selection logic lives in the NuGet client bundled with the SDK and has been serviced into every currently maintained release, including older LTS versions like .NET 6.

Documentation

For the full solution documentation, see the repository README.

Contributing

Contributions are welcome! Please read the Contributing Guidelines before submitting a pull request.

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by the NetEvolve Team Visit us at https://www.daily-devops.net for more information about our services and solutions.

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
0.14.9 0 8/5/2026
0.14.8 0 8/5/2026
0.14.7 0 8/5/2026
0.14.2 42 8/4/2026
0.14.1 41 8/4/2026
0.9.0 45 8/4/2026
0.7.1 48 8/3/2026
0.7.0 44 8/3/2026