Kiruyuto.DotNet.Config 4.0.0

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

<p align="center"> <img src="https://raw.githubusercontent.com/Kiruyuto/.NET-Config/master/.github/resources/readme-banner.png" alt="README banner"> </p>

<p align="center"> Personal set of rules, analyzers, and build defaults distributed as a NuGet package for .NET 11 C# projects. </p>

<p align="center"> <sub> <strong>Heavily</strong> based on <a href="https://github.com/meziantou/">Gérald Barré (@Meziantou)</a>'s "<a href="https://www.meziantou.net/sharing-coding-style-and-roslyn-analyzers-across-projects.htm">Sharing coding style and Roslyn analyzers across projects</a>" post and his <a href="https://github.com/meziantou/Meziantou.DotNet.CodingStandard">CodingStandard</a> repository.<br> This config contains rules changed and fine-tuned to my personal and work needs as well as preferences. </sub> </p>

Usage

Add the NuGet package package to your project, and the configs will be automatically imported.
PrivateAssets="all" prevents the configuration package and its analyzer dependencies from becoming dependencies of a package you publish.

Direct package reference

<ItemGroup>
  <PackageReference Include="Kiruyuto.DotNet.Config" Version="4.0.0" PrivateAssets="all" />
</ItemGroup>

Central package management


<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>

  <ItemGroup>
    <PackageVersion Include="Kiruyuto.DotNet.Config" Version="4.0.0" />
  </ItemGroup>
</Project>

<Project>
  <ItemGroup>
    <PackageReference Include="Kiruyuto.DotNet.Config" PrivateAssets="all" />
  </ItemGroup>
</Project>

Applied defaults

The package imports the following policy into consuming projects:

Area Defaults
C# projects Enables nullable reference types, implicit usings, unsafe code, deterministic builds, and XML documentation. Adds global usings for System.Diagnostics.CodeAnalysis and System.Text, and disables CS1591.
Analysis Enables .NET analyzers and build-time code-style analysis using AnalysisLevel=11-all, strict C# compiler checking, the packaged rule configurations, banned APIs, and analyzer timing reports.
Runtime async Unconditionally enables runtime-native async for consuming projects. Existing compiler feature flags are preserved.
Release and CI Release builds enable optimization and treat MSBuild warnings as errors. CI builds also set ContinuousIntegrationBuild and treat compiler and analyzer warnings as errors.
Package authoring Unless overridden, RepositoryType=git, EmbedUntrackedSources=true, and DebugType=embedded are applied to consumer projects. Embedded PDBs travel inside assemblies; no separate .snupkg is generated.

This is intentionally strict: warnings can fail Release and CI builds. 11-all pins the built-in analyzer profile to .NET 11.

Overriding defaults

NuGet package build props are imported before the body of a consuming project file. Defaults whose values are conditional on being empty can be preselected in Directory.Build.props. Any setting can be overridden later in the project file or in Directory.Build.targets; use Directory.Build.targets for repository-wide overrides that must win over this package's unconditional assignments.

Diagnostic severities and analyzer options can be customized in a project-owned .editorconfig or .globalconfig. Individual compiler or analyzer diagnostics can also be suppressed with the standard MSBuild warning properties.

NuGet excludes package build imports while generating the restore graph, so this package intentionally does not distribute NuGet audit policy. This repository configures audit in its root Directory.Build.props; consuming repositories should configure their own policy there or in another repository-owned MSBuild file evaluated during restore.

This package bans EF Core's AddAsync and AddRangeAsync by default.
Projects that intentionally rely on async value generators, such as HiLo, can disable only those two bans using:

<Project>
  <PropertyGroup>
    <KiruyutoDotNetConfigEnableEntityFrameworkCoreAsyncAddBans>false</KiruyutoDotNetConfigEnableEntityFrameworkCoreAsyncAddBans>
  </PropertyGroup>
</Project>

The toggle also controls the corresponding VSTHRD103 exclusions. Setting it to false removes the async-add bans and stops excluding synchronous Add/AddRange, so VSTHRD103 may recommend their async counterparts in async methods.

Structure overview

Contributing

See CONTRIBUTING.md for guidelines, rule authoring, and local build/testing instructions.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
4.0.0 203 11/12/2026
3.1.2 1,235 10/14/2026
3.1.1 2,362 8/16/2026
3.1.0 241 8/12/2026
3.0.1 250 8/10/2026
3.0.0 228 8/9/2026
2.4.14 941 8/3/2026
2.4.13 376 7/27/2026
2.4.12 336 7/20/2026
2.4.11 368 7/13/2026
2.4.10 454 7/6/2026
2.4.9 267 7/6/2026
2.4.8 1,911 6/10/2026
2.4.7 366 6/8/2026
2.4.6 489 5/19/2026
2.4.5 453 5/13/2026
2.4.4 536 4/30/2026
2.4.2 754 4/12/2026
2.4.1 498 3/30/2026
2.4.0 658 3/14/2026
Loading failed