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

SDK Defaults

These properties are set automatically by the SDK but can be overridden.
PropertyDefaultDescription
LangVersionlatestC# language version
NullableenableNullable reference types
ImplicitUsingsenableImplicit global usings
DeterministictrueReproducible builds
EnableNETAnalyzerstrue.NET code analyzers
AnalysisLevellatest-allAnalysis rule severity
GenerateDocumentationFiletrueGenerate XML docs
EnableSourceLinktrueSource Link support
PublishRepositoryUrltrueInclude repo URL in NuGet
EmbedUntrackedSourcestrueEmbed sources in PDB
EnablePackageValidationtrueNuGet package validation
ManagePackageVersionsCentrallytrueCentral Package Management
TreatWarningsAsErrorstrue (CI/Release)Warnings as errors
EnforceCodeStyleInBuildtrue (CI/Release)Code style enforcement

Feature Toggles

Core Features

PropertyDefaultDescription
InjectSharedThrowtrueInject Throw.IfNull() guard clauses
GenerateClaudeMdtrueGenerate CLAUDE.md for AI assistants
IncludeDefaultBannedSymbolstrueInclude default banned APIs
AutoRegisterServiceDefaultstrueAuto-register service defaults (Web SDK)

Polyfills (Opt-in)

These inject source files for older target frameworks.
PropertyDefaultDescription
InjectTrimAttributesOnLegacyfalseTrimmer/AOT attributes (< net5.0)
InjectNullabilityAttributesOnLegacyfalseNullable reference type attrs (< netcoreapp3.1)
InjectIsExternalInitOnLegacyfalseRecords support (< net5.0)
InjectRequiredMemberOnLegacyfalserequired keyword support (< net7.0)
InjectCallerAttributesOnLegacyfalseCallerArgumentExpression (< net6.0)
InjectUnreachableExceptionOnLegacyfalseUnreachableException (< net7.0)
InjectExperimentalAttributeOnLegacyfalseExperimentalAttribute (< net8.0)
InjectIndexRangeOnLegacyfalseIndex/Range structs (< net5.0)
InjectStackTraceHiddenOnLegacyfalseStackTraceHidden attribute
InjectLockPolyfillfalseSystem.Threading.Lock polyfill
InjectTimeProviderPolyfillfalseTimeProvider polyfill
InjectStringExtensionsPolyfillfalseString.Contains/Replace with StringComparison

Extensions (Opt-in)

PropertyDefaultDescription
InjectSourceGenHelpersfalseEquatableArray, DiagnosticInfo, LocationInfo
InjectCommonComparersfalseStringOrdinalComparer
InjectFakeLoggerfalseFakeLogger test extensions

Bundles (Opt-in)

PropertyDefaultDescription
InjectAllPolyfillsOnLegacyfalseAll polyfills based on TFM
InjectAllExtensionsfalseAll extension utilities

Test Project Properties

These are auto-detected or can be set explicitly.
PropertyAuto-DetectedDescription
IsTestProject.Tests/.Test suffix or tests folderMarks as test project
IsIntegrationTestProjectIntegration/E2E in pathIntegration test project
IsAnalyzerTestProjectAnalyzer in nameAnalyzer test project
SkipXunitInjectionfalseDisable xUnit auto-injection
InjectIntegrationTestFixturestrueInject integration test base classes

Test Framework Defaults

When IsTestProject=true:
PropertyValueDescription
OutputTypeExeExecutable for MTP
TestingPlatformDotnetTestSupporttrueMTP support
UseMicrosoftTestingPlatformRunnertrueUse MTP runner
UseMicrosoftTestingPlatformtrueEnable MTP

NuGet Audit Properties

PropertyDefaultDescription
NuGetAudittrueEnable vulnerability scanning
NuGetAuditModeallAudit mode (all/direct)
NuGetAuditLevellowMinimum severity level

Build Optimization

PropertyDefaultDescription
AccelerateBuildsInVisualStudiotrueVS build acceleration
ReportAnalyzertrueReport analyzer performance
FeaturesstrictEnable strict mode

Usage Examples

Opt-in to Polyfills

<PropertyGroup>
  <InjectLockPolyfill>true</InjectLockPolyfill>
  <InjectTimeProviderPolyfill>true</InjectTimeProviderPolyfill>
</PropertyGroup>

Opt-out of Features

<PropertyGroup>
  <GenerateClaudeMd>false</GenerateClaudeMd>
  <InjectSharedThrow>false</InjectSharedThrow>
  <IncludeDefaultBannedSymbols>false</IncludeDefaultBannedSymbols>
</PropertyGroup>

Web SDK Service Defaults

<PropertyGroup>
  <!-- Disable automatic service defaults registration -->
  <AutoRegisterServiceDefaults>false</AutoRegisterServiceDefaults>
</PropertyGroup>

Test Project Configuration

<PropertyGroup>
  <!-- Use TUnit/NUnit/MSTest instead of xUnit -->
  <SkipXunitInjection>true</SkipXunitInjection>

  <!-- Disable integration test fixture injection -->
  <InjectIntegrationTestFixtures>false</InjectIntegrationTestFixtures>
</PropertyGroup>