SDK MSBuild Properties Reference

This section documents MSBuild 18.9, the .NET SDK 10.0.402 (with its dotnet CLI) and NuGet 7.9, as published in the MSBuild, .NET and NuGet documentation on learn.microsoft.com, which is the reference these pages are written and verified against. Material about .NET 11 / NuGet 8.0 is still in preview and is always flagged as such — never presented as baseline.

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The C# Reference bibliography lists the reference material consulted while preparing these pages.

The .NET SDK reads hundreds of MSBuild properties; this page lists the ones a project or Directory.Build.props typically sets, grouped as in the official reference, each with its default and a link to its documentation. The defaults in the tables were read with dotnet msbuild -getProperty:… from a fresh dotnet new console project targeting net10.0 with .NET SDK 10.0.402 (Debug unless noted); "(empty)" means the property is not set and the SDK behaves as described. Properties of the C# compiler are documented with the compiler options, not on the SDK page; they are linked there.

dotnet msbuild -getProperty:LangVersion -getProperty:Deterministic -getProperty:NuGetAuditMode -getProperty:PublishRelease
{
  "Properties": {
    "LangVersion": "14.0",
    "Deterministic": "true",
    "NuGetAuditMode": "all",
    "PublishRelease": "true"
  }
}

Framework

Property Default Purpose

TargetFramework

from the template (net10.0)

The one target framework.

TargetFrameworks

(empty)

Several, separated by ; — multi-targeting (Target Frameworks and Runtime Identifiers).

NetStandardImplicitPackageVersion

(SDK default)

The NETStandard.Library version for netstandard1.x.

Build and compiler

Property Default Purpose

Nullable

(empty) — enable in the templates

Nullable reference type analysis.

LangVersion

14.0 for net10.0

C# version; the default follows the target framework.

ImplicitUsings

(empty) — enable in the templates

Generated global using directives.

Deterministic

true

Same inputs, same assembly bytes.

ContinuousIntegrationBuild

(empty)

Normalise paths for CI builds (Reproducible and Deterministic Builds).

GenerateDocumentationFile

false

Produce the XML documentation file.

DocumentationFile

(derived)

Its path.

EnablePreviewFeatures

(empty)

Allow preview APIs and language features.

DisableImplicitFrameworkDefines

(empty)

Turn off NET8_0_OR_GREATER-style symbols.

EnableWindowsTargeting

(empty)

Build Windows-only projects on Linux/macOS.

TreatWarningsAsErrors

false

Every warning becomes an error.

Optimize, DebugType

false, portable (Release: true, portable)

Optimisation and PDB format.

GenerateAssemblyInfo

true

Generate assembly attributes from Version, Company, …

SourceRevisionId

(from Source Link)

Commit appended to the informational version.

Default items

Property Default Purpose

EnableDefaultItems

true

Master switch for the globs below.

EnableDefaultCompileItems

true

**/*.cs as Compile.

EnableDefaultEmbeddedResourceItems

true

**/*.resx as EmbeddedResource.

EnableDefaultNoneItems

true

Everything else as None.

DefaultItemExcludes

bin, obj, **/*.user, **/*.*proj, **/*.sln, **/*.slnx, …

Excluded from all default globs.

The evaluated DefaultItemExcludes of the console project was ;bin\Debug//**;obj/Debug//**;bin\/**;obj//**;bin\Debug/net10.0/publish//**;**/*.user;**/*.*proj;**/*.sln;**/*.slnx;**/*.vssscc;**/.DS_Store (SDK-Style Project Files).

Code analysis and SDK

Property Default Purpose

EnableNETAnalyzers

true

Run the CA analyzers.

AnalysisLevel

latest

Rule set version.

AnalysisMode

(empty) = Default

How many rules are on.

EnforceCodeStyleInBuild

false

Report IDE rules in builds.

CodeAnalysisTreatWarningsAsErrors

(empty)

CA warnings as errors, separately.

SdkAnalysisLevel

the SDK band (10.0.400)

Behave like an older SDK band for SDK diagnostics.

References and restore

Property Default Purpose

ManagePackageVersionsCentrally

(empty)

Central Package Management (Central Package Management).

DisableTransitiveProjectReferences

(empty)

Do not flow project references transitively.

DisableImplicitFrameworkReferences

(empty)

Do not reference the shared framework implicitly.

AssetTargetFallback

(empty)

Allow packages built for other frameworks.

RestorePackagesWithLockFile

(empty)

Write and use packages.lock.json (Lock Files and Locked Mode).

NuGetAudit, NuGetAuditMode, NuGetAuditLevel

true, all, low

Vulnerability audit during restore (Auditing Packages for Vulnerabilities).

The restore properties are documented on the NuGet side (NuGet restore properties).

Run, testing and generated files

Property Default Purpose

RunArguments

(empty)

Arguments for dotnet run.

RunWorkingDirectory

(empty)

Working directory for dotnet run.

IsTestProject

(empty) — true with Microsoft.NET.Test.Sdk

Marks a test project (not packable by default).

UseMicrosoftTestingPlatformRunner

(framework-specific)

Run with MTP instead of VSTest.

TestingPlatformDotnetTestSupport

(empty)

MTP via dotnet test in VSTest mode (before global.json test.runner).

EmitCompilerGeneratedFiles

(empty)

Write source-generator output to disk.

CompilerGeneratedFilesOutputPath

(empty)

Where.

DisableImplicitNamespaceImports

(empty)

Turn off the implicit namespace imports of Visual Basic projects.

Publish, trimming and runtime configuration

Property Default Purpose

RuntimeIdentifier

(empty)

Target platform.

RuntimeIdentifiers

(empty)

Platforms to restore for.

SelfContained

false

Include the runtime.

UseAppHost

true

Native launcher.

PublishRelease

true

dotnet publish builds Release.

IsPublishable

true

dotnet publish on a solution includes the project.

AppendTargetFrameworkToOutputPath

true

bin/Debug/net10.0/.

GenerateRuntimeConfigurationFiles

true

Write runtimeconfig.json.

RollForward

(empty) = Minor

Runtime roll-forward policy of the app.

SatelliteResourceLanguages

(empty)

Keep only these resource cultures.

PublishTrimmed, PublishAot, PublishSingleFile, PublishReadyToRun

(empty)

Publishing modes (Publish and Deployment Models; trim-related properties).

InvariantGlobalization

(empty)

No culture data (smaller, no ICU).

TieredPGO

(empty) = on

Dynamic profile-guided optimisation.

ServerGarbageCollection

(empty) = off

Server GC.

ConcurrentGarbageCollection

(empty) = on

Background GC.

Packages and package validation

Property Default Purpose

PackRelease

true

dotnet pack builds Release.

IsPackable

true (false for test projects)

Whether dotnet pack packs the project.

PackageId, Version, Authors, Description, PackageTags, PackageLicenseExpression, PackageReadmeFile, PackageIcon, RepositoryUrl

(derived or empty)

Package metadata (descriptive properties; Package Metadata, README, Icon and License).

EnablePackageValidation

(empty)

Validate the package’s API across frameworks and versions.

PackageValidationBaselineVersion

(empty)

Compare against this published version.

ApiCompatGenerateSuppressionFile

(empty)

Write accepted differences to a suppression file.

Items

Item Purpose

PackageReference

A NuGet dependency (PackageReference).

FrameworkReference

A shared framework such as Microsoft.AspNetCore.App.

Using

A global using (Static="true", Alias="…").

InternalsVisibleTo

Generates [assembly: InternalsVisibleTo] (Key metadata for strong names).

AssemblyMetadata

Generates [assembly: AssemblyMetadata(key, value)].

TrimmerRootAssembly

Keep an assembly entirely when trimming.

Item metadata such as CopyToPublishDirectory and LinkBase are listed at Item metadata. Windows desktop projects (WPF, Windows Forms) have further properties at MSBuild reference for Microsoft.NET.Sdk.WindowsDesktop.

Common mistakes

  • Believing Nullable and ImplicitUsings are SDK defaults — the templates set them; an empty project has neither.

  • Setting TargetFramework and TargetFrameworks together — the singular wins for the outer build, with confusing results.

  • Changing DefaultItemExcludes without the $(DefaultItemExcludes); prefix — bin and obj get compiled.

  • Looking for compiler options on the SDK page — LangVersion, Nullable, Deterministic live in the C# compiler options reference.