ConfigContraband 0.9.2
dotnet add package ConfigContraband --version 0.9.2
NuGet\Install-Package ConfigContraband -Version 0.9.2
<PackageReference Include="ConfigContraband" Version="0.9.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="ConfigContraband" Version="0.9.2" />
<PackageReference Include="ConfigContraband"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add ConfigContraband --version 0.9.2
#r "nuget: ConfigContraband, 0.9.2"
#:package ConfigContraband@0.9.2
#addin nuget:?package=ConfigContraband&version=0.9.2
#tool nuget:?package=ConfigContraband&version=0.9.2
<p align="center"> <img src="https://raw.githubusercontent.com/georgepwall1991/ConfigContraband/main/assets/configcontraband-icon.png" width="96" height="96" alt="ConfigContraband icon — Roslyn analyzer for .NET Options and appsettings validation"> </p>
ConfigContraband
Compile-time Options validation for .NET — a Roslyn analyzer that checks BindConfiguration, ValidateOnStart, ValidateDataAnnotations, and appsettings.json against your IOptions types so broken configuration fails in the editor and CI, not production.
Install
<PackageReference Include="ConfigContraband" Version="0.9.2" PrivateAssets="all" />
dotnet add package ConfigContraband
No runtime dependency. Analyzers run at build time and in supported IDEs. Visible appsettings*.json files are passed automatically via buildTransitive props.
What it catches
- Section typos in
BindConfiguration(...)/Configure<T>(GetSection(...)) - Missing
[Required]keys in visible appsettings - Validation without
ValidateOnStart()orValidateDataAnnotations()(including Microsoft's[OptionsValidator]source-generator path) - Nested options that look validated but are skipped
- Misspelled JSON keys, strict unknown-key failures, scalar conversion errors, and DataAnnotations constraint failures
- Direct
IConfigurationreads whose path is missing from visible appsettings
When the analyzer cannot prove a configuration shape statically, it stays quiet.
See it work
Next steps
- Copy-paste green sample: ConfigContraband.Quickstart
- Full rule reference (
CFG001–CFG010): README on GitHub - Optional IntelliSense schema tool: ConfigContraband.Tool
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.9.2 | 0 | 8/25/2026 |
| 0.9.1 | 0 | 8/25/2026 |
| 0.9.0 | 90 | 8/12/2026 |
| 0.8.0 | 85 | 8/12/2026 |
| 0.7.29 | 84 | 8/12/2026 |
| 0.7.28 | 83 | 8/12/2026 |
| 0.7.27 | 98 | 8/12/2026 |
| 0.7.26 | 107 | 7/26/2026 |
| 0.7.25 | 108 | 7/26/2026 |
| 0.7.24 | 105 | 7/25/2026 |
| 0.7.23 | 99 | 7/25/2026 |
| 0.7.22 | 105 | 7/21/2026 |
| 0.7.21 | 104 | 7/21/2026 |
| 0.7.20 | 95 | 7/16/2026 |
| 0.7.19 | 104 | 7/16/2026 |
| 0.7.18 | 95 | 7/16/2026 |
| 0.7.17 | 99 | 7/16/2026 |
| 0.7.16 | 98 | 7/16/2026 |
| 0.7.15 | 100 | 7/16/2026 |
| 0.7.14 | 100 | 7/16/2026 |
The CFG001 section-literal code fix now rewrites a const local's initializer instead of inlining a literal at the use site, so every usage of the constant is corrected at once.