Proctorio.EditorConfig 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Proctorio.EditorConfig --version 2.0.0
                    
NuGet\Install-Package Proctorio.EditorConfig -Version 2.0.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.0.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.0.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.0.0
                    
#r "nuget: Proctorio.EditorConfig, 2.0.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.0.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.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Proctorio.EditorConfig&version=2.0.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.

What This Enforces

Explicit types - No var. Ever.

// ❌ This will warn
var user = GetUser();

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

Private field naming - Must use underscore prefix.

// ❌ Warning
private string userName;

// ✅ Correct
private string _userName;

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

// ❌ Warning if never reassigned
private IUserRepository _repo;

// ✅ Better
private readonly IUserRepository _repo;

CancellationToken forwarding - Pass tokens through async calls.

// ❌ Warning
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.0.1 564 1/2/2026
2.0.0 342 11/7/2025

v2.0.0: Universal package with comprehensive C# style rules, explicit type enforcement, modern C# patterns, and full formatting standards.