Skip to main content
Complete reference of all MSBuild properties available in ANcpLua.NET.Sdk.

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

LangVersion
string
default:"latest"
C# language version. SDK enforces latest by default.
Nullable
enable|disable|warnings|annotations
default:"enable"
Nullable reference types. Enabled by default.
ImplicitUsings
enable|disable
default:"enable"
Enable implicit global usings.
Deterministic
bool
default:"true"
Produce reproducible builds with identical binary output.
TreatWarningsAsErrors
bool
default:"true (CI/Release)"
Treat all warnings as errors in CI or Release builds.
EnforceCodeStyleInBuild
bool
default:"true (CI/Release)"
Enforce code style rules during build in CI or Release.
Enable SourceLink for debugging into source. Requires git repository.
PublishRepositoryUrl
bool
default:"true"
Include repository URL in NuGet package metadata.
EmbedUntrackedSources
bool
default:"true"
Embed source files not tracked by git in the PDB.
IncludeSourceRevisionInInformationalVersion
bool
default:"true"
Include git commit hash in assembly informational version.

Package Management

ManagePackageVersionsCentrally
bool
default:"true"
Enable Central Package Management (CPM).
CentralPackageTransitivePinningEnabled
bool
default:"true"
Pin transitive package versions centrally.
EnablePackageValidation
bool
default:"true"
Validate NuGet packages during build.

NuGet Audit

NuGetAudit
bool
default:"true"
Enable security vulnerability auditing for packages.
NuGetAuditMode
direct|all
default:"all"
Audit mode: direct for direct dependencies only, all for transitive too.
NuGetAuditLevel
low|moderate|high|critical
default:"low"
Minimum vulnerability severity to report.

Code Injection

Shared Code

InjectSharedThrow
bool
default:"true"
Inject Throw guard clause utilities. Provides Throw.IfNull(), Throw.IfNullOrEmpty(), etc.
GenerateClaudeMd
bool
default:"true"
Auto-generate CLAUDE.md files for AI assistant context.

Polyfills (Legacy TFM Support)

All polyfills default to false and are opt-in. Set to true to inject.
InjectAllPolyfillsOnLegacy
bool
default:"false"
Bundle: Inject all applicable polyfills based on target framework.
InjectIndexRangeOnLegacy
bool
default:"false"
Index/Range structs for netstandard2.0 and older TFMs (enables array[^1] syntax).
InjectIsExternalInitOnLegacy
bool
default:"false"
IsExternalInit for init-only properties and records (pre-.NET 5).
InjectRequiredMemberOnLegacy
bool
default:"false"
required keyword support (pre-.NET 7).
InjectNullabilityAttributesOnLegacy
bool
default:"false"
Nullable reference type attributes (pre-.NET Core 3.1).
InjectCallerAttributesOnLegacy
bool
default:"false"
CallerArgumentExpression attribute (pre-.NET 6).
InjectUnreachableExceptionOnLegacy
bool
default:"false"
UnreachableException type (pre-.NET 7).
InjectExperimentalAttributeOnLegacy
bool
default:"false"
ExperimentalAttribute (pre-.NET 8).
InjectTrimAttributesOnLegacy
bool
default:"false"
Trimmer/AOT attributes (pre-.NET 5).
InjectStringExtensionsPolyfill
bool
default:"false"
String methods with StringComparison parameter (fixes CA1307/CA2249 on netstandard2.0).
InjectTimeProviderPolyfill
bool
default:"false"
TimeProvider abstraction for testable time operations.
InjectLockPolyfill
bool
default:"false"
System.Threading.Lock type polyfill.

Extensions

InjectSourceGenHelpers
bool
default:"false"
Source generator helpers: EquatableArray, DiagnosticInfo, LocationInfo.
InjectCommonComparers
bool
default:"false"
Common comparers including StringOrdinalComparer.
InjectFakeLogger
bool
default:"false"
FakeLogger for testing logging in unit tests.

Analyzer Configuration

EnableNETAnalyzers
bool
default:"true"
Enable built-in .NET analyzers.
AnalysisLevel
string
default:"latest-all"
Analysis level: latest-all enables all latest analyzers.
ReportAnalyzer
bool
default:"true"
Report analyzer execution time in build output.

Usage Examples

Use InjectAllPolyfillsOnLegacy to enable all polyfills at once, or enable specific ones individually.
<PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <InjectAllPolyfillsOnLegacy>true</InjectAllPolyfillsOnLegacy>
</PropertyGroup>
Disable auto-generated code or shared utilities when not needed.
<PropertyGroup>
    <GenerateClaudeMd>false</GenerateClaudeMd>
</PropertyGroup>