The MSBuild schema allows any item type and
any property name; what they mean is set by the targets files a project imports. This
page lists the ones MSBuild itself defines as common, and the defaults of SDK-style
projects. Properties and items that the .NET SDK adds (such as
TargetFramework, Nullable and PackageReference)
are documented separately in Microsoft’s
MSBuild
reference for .NET SDK projects and are not repeated here.
SDK-style projects
A project that names an SDK (in <Project Sdk="…">, an
<Sdk Name="…" Version="…"/> element, or an Import with
Sdk) gets the SDK’s Sdk.props imported at the top and
Sdk.targets at the bottom. A version can follow the name
(MSBuild.Sdk.Extras/2.0.54) or come from global.json.
| SDK | For |
|---|---|
Microsoft.NET.Sdk | The .NET SDK, base of the others; also used, with extra properties, for Windows Forms and WPF. |
Microsoft.NET.Sdk.Web | Web projects; builds on the .NET and Razor SDKs. |
Microsoft.NET.Sdk.Razor | Razor. |
Microsoft.NET.Sdk.BlazorWebAssembly | Blazor WebAssembly. |
Microsoft.NET.Sdk.Worker | Worker services. |
Aspire.AppHost.Sdk | Aspire app hosts (added alongside Microsoft.NET.Sdk). |
MSTest.Sdk | MSTest test projects. |
Default items
| Item | Include | Exclude | Remove |
|---|---|---|---|
Compile | **/*.cs (or the language’s extension) | **/*.user; **/*.*proj; **/*.sln(x); **/*.vssscc; and the bin and obj folders (DefaultItemExcludes) | – |
EmbeddedResource | **/*.resx | – | |
None | **/* | **/*.cs; **/*.resx |
Listing the same files again gives error NETSDK1022; use Update or
Remove, or turn the defaults off with EnableDefaultItems,
EnableDefaultCompileItems or EnableDefaultEmbeddedResourceItems
set to false.
Implicit usings
With ImplicitUsings on, C# projects get generated
global using directives. For Microsoft.NET.Sdk:
System, System.Collections.Generic, System.IO,
System.Linq, System.Net.Http, System.Threading,
System.Threading.Tasks; the Web, Worker and Windows Desktop SDKs add or
remove some. Using items add more (Import items in Visual
Basic).
Build events
SDK-style projects run pre- and post-build commands as targets, e.g.
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> with an
Exec task, rather than with the PreBuildEvent and
PostBuildEvent properties.
Common items
Optional metadata that is not set is empty.
| Item | Represents | Metadata |
|---|---|---|
Reference | A .NET assembly reference. | HintPath, Name, FusionName, SpecificVersion, Aliases, Private (copy to output; default false) |
COMReference | A COM component, found through the registry. | Name, Guid (required), VersionMajor (required), VersionMinor (required), EmbedInteropTypes, Lcid, WrapperTool (primary, tlbimp, primaryortlbimp, aximp), Isolated |
COMFileReference | Type libraries by file path. | EmbedInteropTypes, WrapperTool |
NativeReference | A native manifest file. | Name (required), HintPath (required) |
ProjectReference | Another project; turned into Reference items. | Name, GlobalPropertiesToRemove, Project (a GUID), OutputItemType, ReferenceOutputAssembly (default true), BuildReference (default true), Private, SetConfiguration, SetPlatform, SetTargetFramework, SkipGetTargetFrameworkProperties, Targets |
Compile | Source files for the compiler. | DependentUpon, AutoGen, Link, Visible, CopyToOutputDirectory |
EmbeddedResource | Resources embedded in the assembly. | Culture, WithCulture, DependentUpon, Generator, LastGenOutput, CustomToolNamespace, Link, Visible, CopyToOutputDirectory, LogicalName |
Content | Files published with the project but not compiled. | DependentUpon, Generator, LastGenOutput, CustomToolNamespace, Link, PublishState (Default, Included, Excluded, DataFile, Prerequisite), IsAssembly, Visible, CopyToOutputDirectory, TargetPath |
None | Files with no role in the build. | DependentUpon, Generator, LastGenOutput, CustomToolNamespace, Link, Visible, CopyToOutputDirectory |
AssemblyMetadata | An [AssemblyMetadata(key, value)] attribute (.NET 5 SDK and later). | Include (the key), Value (required) |
InternalsVisibleTo | An [InternalsVisibleTo] attribute (.NET 5 SDK and later). | Include (the assembly), Key |
BaseApplicationManifest | The base application manifest, with ClickOnce security information. | – |
CodeAnalysisImport | An FxCop project to import. | – |
Import | Namespaces imported by the Visual Basic compiler. | – |
Folder | A placeholder for an empty folder in Visual Studio. | – |
CopyToOutputDirectory is Never, Always,
PreserveNewest or IfDifferent.
Common properties
Applies to: all projects, .NET projects, or the named language.
| Property | For | Meaning |
|---|---|---|
AdditionalLibPaths | .NET | Extra folders to search for reference assemblies. |
AddModules | .NET | Modules whose types are made available (/addModules). |
ALToolPath | .NET | Path to AL.exe. |
ApplicationIcon | .NET | .ico file embedded as the Win32 icon. |
ApplicationManifest | all | File for the User Account Control manifest. |
AssemblyOriginatorKeyFile | .NET | .snk or .pfx file used to sign the assembly. |
AssemblySearchPaths | .NET | Where to resolve references, in order. |
AssemblyName | .NET | Name of the output assembly. |
BaseAddress | .NET | Base address of the output assembly. |
BaseIntermediateOutputPath | all | Top intermediate folder, default obj\. |
BaseOutputPath | all | Base output folder; OutputPath becomes $(BaseOutputPath)\$(Configuration)\. |
BuildInParallel | all | Build project references in parallel (default true). |
BuildProjectReferences | all | Whether MSBuild builds project references. |
CleanFile | all | Name of the “clean cache” file listing generated files. |
CodePage | .NET | Code page of the source files. |
CompilerResponseFile | .NET | A response file for the compiler. |
Configuration | all | The configuration being built, usually Debug or Release. |
CscToolPath | C# | Path to csc.exe. |
CustomBeforeMicrosoftCommonTargets, CustomAfterMicrosoftCommonTargets | all | Files imported before or after the common targets. |
DebugSymbols | all | Whether symbols (.pdb) are produced. |
DebugType | all | full, pdbonly, portable, embedded or none. |
DefineConstants | .NET | Conditional compilation symbols. |
DefineDebug, DefineTrace | all | Define DEBUG / TRACE. |
DelaySign | .NET | Delay-sign rather than fully sign. |
Deterministic | .NET | Produce deterministic output. |
DeterministicTimestamp | all | Timestamp (RFC 3339 or Unix seconds) used by deterministic tasks. |
DirectoryBuildPropsPath, DirectoryBuildTargetsPath | all | Paths to Directory.Build.props / .targets. |
DisableFastUpToDateCheck | all | Visual Studio only: use MSBuild to decide whether to rebuild. |
DocumentationFile | .NET | Name of the XML documentation file. |
ErrorReport | .NET | prompt, send or none. |
ExcludeDeploymentUrl | .NET | Leave the deploymentProvider tag out of a ClickOnce manifest. |
FileAlignment | .NET | Section alignment: 512, 1024, 2048, 4096 or 8192. |
FrameworkPathOverride | Visual Basic | Location of mscorlib.dll and microsoft.visualbasic.dll. |
GenerateDocumentationFile | .NET | Produce the XML documentation file. |
GenerateFullPaths | C# | Full paths in compiler messages. |
GenerateResourceUsePreserializedResources | .NET | Use preserialised resources when converting .resx. |
GenerateSerializationAssemblies | .NET | Run SGen.exe: on, auto or off. |
ImportDirectoryBuildProps, ImportDirectoryBuildTargets | all | Whether to import Directory.Build.props / .targets. |
IntermediateOutputPath | all | Full intermediate folder, e.g. obj\debug\. |
KeyContainerName, KeyOriginatorFile | all | Strong-name key container or file. |
ModuleAssemblyName | .NET | Assembly a module is compiled into. |
MSBuildProjectExtensionsPath | all | Where project extensions are; default as BaseIntermediateOutputPath. |
MSBuildTreatWarningsAsErrors, MSBuildWarningsAsErrors, MSBuildWarningsAsMessages | all | Treat MSBuild warnings as errors (all, or the listed codes), or as messages. |
NoLogo | all | Turn off the compiler logo. |
NoStdLib | .NET | Do not reference mscorlib.dll. |
NoVBRuntimeReference | Visual Basic | Leave out Microsoft.VisualBasic.dll. |
NoWarn | .NET | Warning numbers to suppress. |
NoWin32Manifest | .NET | Do not embed UAC manifest information. |
Optimize | .NET | Turn on compiler optimisations. |
OptionCompare, OptionExplicit, OptionInfer, OptionStrict | Visual Basic | The language options (binary/text; booleans). |
OutDir | all | Final output folder, e.g. bin\Debug. |
OutputPath | all | Output folder relative to the project. |
OutputType | all | Library (default), Exe, Module or Winexe. |
OverwriteReadOnlyFiles | all | Overwrite read-only files instead of failing. |
PathMap | .NET | Map physical paths to source paths in output. |
PdbFile | .NET | Name of the .pdb file. |
Platform | all | Target platform, e.g. Any CPU, x86, x64. |
ProcessorArchitecture | .NET | msil, x86, amd64 or ia64 for resolving references. |
ProduceReferenceAssembly, ProduceOnlyReferenceAssembly | .NET | Also produce, or only produce, a reference assembly. |
RegisterAssemblyMSBuildArchitecture | Windows | x86, x64 or ARM64 registry hive for COM registration. |
RegisterForCOMInterop | Windows | Register a COM-callable wrapper on the build machine. |
RemoveIntegerChecks | Visual Basic | Turn off overflow checks. |
RootNamespace | all | Root namespace for embedded resource names. |
Satellite_* | .NET | Settings passed to AL.exe for satellite assemblies: AlgorithmId, BaseAddress, CompanyName, Configuration, Description, EvidenceFile, FileVersion, Flags, GenerateFullPaths, LinkResource, MainEntryPoint, ProductName, ProductVersion, TargetType, Title, Trademark, Version, Win32Icon, Win32Resource. |
SGenToolPath, SGenUseProxyTypes | .NET | SGen.exe location and proxy-type option. |
SkipInvalidConfigurations | all | Warn rather than fail on invalid platform/configuration pairs. |
StartupObject | .NET | Class containing Main. |
SubsystemVersion | .NET | Minimum subsystem version. |
TargetCompactFramework, TargetFrameworkVersion | .NET | Required .NET Compact Framework / .NET Framework version. |
TreatWarningsAsErrors, WarningsAsErrors, WarningsNotAsErrors | .NET | Compiler warnings treated, or not treated, as errors. |
UseCommonOutputDirectory | .NET | All outputs share one folder; references are not copied. |
UseHostCompilerIfAvailable | .NET | Visual Studio only: use the in-process compiler. |
Utf8Output | .NET | Compiler output in UTF-8. |
VbcToolPath, VbcVerbosity | Visual Basic | vbc.exe location; Quiet, Normal or Verbose. |
VisualStudioVersion | all | Visual Studio version to build as, default major.0. |
WarningLevel | all | Compiler warning level. |
Win32Manifest, Win32Resource | .NET | Manifest or .res file to embed. |
Sources
Microsoft Learn: Common MSBuild project items, Common MSBuild project properties and .NET project SDK overview (SDKs, implicit imports, default globs, implicit usings, build events). .NET SDK–specific properties are not covered on this page.