Tips & tricks to improve your .NET build setup with MSBuild
summary
Practical MSBuild recipes: use Directory.Build.props and Directory.Build.targets to apply CI-only flags (treat warnings as errors for Release) and to centralize publishing defaults; enable central NuGet versions with Directory.Packages.props; generate semantic package versions with Nerdbank.GitVersioning (local dotnet tool) so CI produces incremental versions; prefer CopyToOutputDirectory=PreserveNewest to avoid constant rebuilds; inspect failures with MSBuild -bl and the MSBuild Structured Log Viewer; use Microsoft.NETFramework.ReferenceAssemblies to build .NET Framework targets cross‑platform.
AI-written summary · about
chapters (11)
- 0:00Introduction and setup
- 1:02MSBuild fundamentals
- 6:18Practical syntax and items
- 17:10Evaluation order and debugging
- 22:53Advanced project customization
- 30:10Managing package dependencies
- 33:33Git-based versioning
- 39:29Handling files and resources
- 44:55Advanced build and framework tips
- 50:31Feature flags and diagnostic logs
- 59:28Q&A and closing
