Directory.Build.props
An MSBuild file placed in a folder that every project in that folder and below imports automatically, used for shared build settings.
In more detail
It is the place for repository-wide policy such as Nullable, TreatWarningsAsErrors and AnalysisLevel. It lists no projects and no source files, only properties.
Related terms
- MSBuild — The build engine behind .NET that reads project files and runs the steps that restore packages, compile code and produce output.
- project file — The XML file, such as Hello.csproj, that tells the build which SDK, target framework, packages and settings a project uses.
- central package management — A NuGet feature that records every package version for a repository in one Directory.Packages.props file, so project files name packages without versions.
- TreatWarningsAsErrors — The build property that turns every compiler and analyzer warning into an error, so code with warnings fails to build.
Taught in
- Directory.Build.props, global.json and Central Packages — Modern .NET Core, C# & Enterprise Microservices
- Code Quality: .editorconfig and Roslyn Analyzers — Modern .NET Core, C# & Enterprise Microservices