Build Configuration
Language version, nullable types, and build settings
Source Control
SourceLink and repository metadata
Package Management
Central Package Management and NuGet audit
Code Injection
Polyfills, shared code, and extensions
Analyzers
Built-in .NET analyzers configuration
Usage Examples
Common configuration patterns
Build Configuration
string
default:"latest"
C# language version. SDK enforces
latest by default.enable|disable|warnings|annotations
default:"enable"
Nullable reference types. Enabled by default.
enable|disable
default:"enable"
Enable implicit global usings.
bool
default:"true"
Produce reproducible builds with identical binary output.
bool
default:"true (CI/Release)"
Treat all warnings as errors in CI or Release builds.
bool
default:"true (CI/Release)"
Enforce code style rules during build in CI or Release.
Source Control & SourceLink
bool
default:"true"
Enable SourceLink for debugging into source. Requires git repository.
bool
default:"true"
Include repository URL in NuGet package metadata.
bool
default:"true"
Embed source files not tracked by git in the PDB.
bool
default:"true"
Include git commit hash in assembly informational version.
Package Management
bool
default:"true"
Enable Central Package Management (CPM).
bool
default:"true"
Pin transitive package versions centrally.
bool
default:"true"
Validate NuGet packages during build.
NuGet Audit
bool
default:"true"
Enable security vulnerability auditing for packages.
direct|all
default:"all"
Audit mode:
direct for direct dependencies only, all for transitive too.low|moderate|high|critical
default:"low"
Minimum vulnerability severity to report.
Code Injection
Shared Code
Inject
Throw guard clause utilities. Provides Throw.IfNull(),
Throw.IfNullOrEmpty(), etc.bool
default:"true"
Auto-generate
CLAUDE.md files for AI assistant context.Polyfills (Legacy TFM Support)
All polyfills default tofalse and are opt-in. Set to true to inject.
bool
default:"false"
Bundle: Inject all applicable polyfills based on target framework.
bool
default:"false"
Index/Range structs for
netstandard2.0 and older TFMs (enables array[^1]
syntax).bool
default:"false"
IsExternalInit for init-only properties and records (pre-.NET 5).bool
default:"false"
required keyword support (pre-.NET 7).bool
default:"false"
Nullable reference type attributes (pre-.NET Core 3.1).
bool
default:"false"
CallerArgumentExpression attribute (pre-.NET 6).bool
default:"false"
UnreachableException type (pre-.NET 7).bool
default:"false"
ExperimentalAttribute (pre-.NET 8).bool
default:"false"
Trimmer/AOT attributes (pre-.NET 5).
bool
default:"false"
String methods with
StringComparison parameter (fixes CA1307/CA2249 on
netstandard2.0).bool
default:"false"
TimeProvider abstraction for testable time operations.bool
default:"false"
System.Threading.Lock type polyfill.Extensions
bool
default:"false"
Source generator helpers:
EquatableArray, DiagnosticInfo, LocationInfo.bool
default:"false"
Common comparers including
StringOrdinalComparer.bool
default:"false"
FakeLogger for testing logging in unit tests.Analyzer Configuration
bool
default:"true"
Enable built-in .NET analyzers.
string
default:"latest-all"
Analysis level:
latest-all enables all latest analyzers.bool
default:"true"
Report analyzer execution time in build output.
Usage Examples
Polyfill Configuration
Polyfill Configuration
Use
InjectAllPolyfillsOnLegacy to enable all polyfills at once, or enable specific ones individually.Code Injection Options
Code Injection Options
Disable auto-generated code or shared utilities when not needed.
