Skip to content

Guardrails

dotnet ​

4 guardrails, all at version v1.

GuardrailDefault severityWhat it checks
dotnet/central-package-managementwarningA single Directory.Packages.props sets the version of every package, instead of each project file setting its own.
dotnet/dependencies-versionederrorEvery PackageReference names its own version or takes one from a central PackageVersion.
dotnet/sdk-pinnedwarningglobal.json names the SDK the build uses and holds it there, so a newer SDK on the runner can't take over.
dotnet/target-framework-floorwarningEvery net<major>.<minor> framework a project targets is no older than the configured floor.

Shared inputs ​

Every dotnet guardrail declares these inputs. Individual guardrails can add their own.

InputDescriptionDefault
projectDirDirectory holding the project, relative to the directory the CLI runs in..

Shared collectors ​

Every dotnet guardrail receives the facts these collectors gather. Individual guardrails can ask for more collectors of their own.

CollectorGathers
dotnetThe .NET build in the project directory: the SDK it pins, every project file and the frameworks each targets, the packages they reference and which of them are pinned or supplied centrally, and the lock files beside them.

You configure every guardrail in this category the same way, in the guardrails.checks array of buildnote.json. Configuring guardrails lists every option, and Guardrails lets you search the whole library.

Buildnote Limited
Registered in England and Wales, Reg: 16140412