Proctorio.EditorConfig 2.2.0

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

Proctorio.EditorConfig

Standardized C# code style rules for all Proctorio projects.

Install

dotnet add package Proctorio.EditorConfig

That's it. Rules apply automatically on build.

Severities

Correctness analyzers (Reliability, Security and Usage categories, for example CA2xxx) and compiler nullability warnings are warnings. Style, naming, documentation, design, maintainability, performance and globalization analyzers are suggestions: they show in the IDE and do not appear as build warnings. Underscore test names (CA1707) and namespace style are therefore fine.

CS1591 (missing XML comment) is only reported for packable libraries. Executables, test projects and projects with <IsPackable>false</IsPackable> have it suppressed.

2.2.0: correct severities on the first build

The package now also ships its rules as a global analyzer config, Proctorio.EditorConfig.globalconfig, generated from the same .editorconfig and added to the build automatically. The compiler reads it before anything is compiled, so a fresh checkout (every CI build) gets the right severities on its very first build. Before, the severities came only from the .editorconfig copied into your project folder during the build, and a project that did not commit that copy compiled once without it.

You no longer need to commit the copied .editorconfig, and a repo that gitignores it works. The copy is still written for IDE formatting and is unchanged.

If a project tracks an OLD copied .editorconfig (from a 1.x or 2.0.x package), that file wins over the global config because path-based .editorconfig files take precedence. Update it by building once with 2.2.0 and committing the new copy, or delete it.

What This Enforces

The first three examples below are IDE suggestions, so they do not fail or warn in the pipeline. The last one, CA2016, is a Reliability rule and is still a build warning.

Explicit types - No var. Ever.

// ❌ Suggestion
var user = GetUser();

// ✅ Do this
User user = GetUser();

Private field naming - Must use underscore prefix.

// ❌ Suggestion
private string userName;

// ✅ Correct
private string _userName;

Readonly fields - If a field doesn't change, mark it readonly.

// ❌ Suggestion if never reassigned
private IUserRepository _repo;

// ✅ Better
private readonly IUserRepository _repo;

CancellationToken forwarding - Pass tokens through async calls.

// ❌ Warning (CA2016)
await DoWorkAsync();

// ✅ Pass it along
await DoWorkAsync(cancellationToken);

What This Suggests

These show as suggestions, not warnings:

  • Use pattern matching over as/is checks
  • Use object/collection initializers
  • Use null coalescing (??) and null propagation (?.)
  • Use throw expressions
  • Mark static members when possible
  • Convert typeof(T) to nameof(T) where valid

What This Doesn't Enforce

Ternary operators - Feel free to use them (or don't). Exception handling - CA1031 is off. Catch what you need. Null checks - CA1062 is off. Not every public method needs null guards. Localization - CA1303 is off. String literals are fine.

Formatting

Braces - Always required, even for single statements.

// ❌ No
if (condition)
    DoSomething();

// ✅ Yes
if (condition)
{
    DoSomething();
}

Brace style - Allman (new line).

if (condition)
{
    // code
}

Indentation - 4 spaces for C#, tabs for XML/config.

Spacing

  • Space after keywords: if (x)
  • No space after cast: (int)value
  • Space around binary operators: x + y

Naming Conventions

Type Format Example
Interfaces I + PascalCase IUserRepository
Classes, Methods, Properties PascalCase UserService, GetUser()
Private fields _camelCase _userName
Private constants PascalCase MaxRetries

ConfigureAwait

The default package doesn't require .ConfigureAwait(false). If you need that, use the -RequireConfigureAwait variant (when available).

IDE Setup

Visual Studio / Rider - Works out of the box after package install.

VS Code - Install C# Dev Kit, then add the package.

Testing

This package has 34 automated tests covering rule syntax, formatting, and build integration.

dotnet test
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
2.2.0 113 10/11/2026
2.1.0 110 10/11/2026
2.0.6 113 10/1/2026
2.0.1 7,492 1/2/2026
2.0.0 698 11/7/2025