WindowsLinuxmacOS

Where Does MSBuild Read Config and Write Logs?

MSBuild reads Directory.Build.props and Directory.Build.targets walking up from each project, with binary logs (.binlog) written wherever you point -bl and artifacts in bin and obj.

Last updated

MSBuild discovers configuration by walking upward from each project file. Directory.Build.props injects shared properties while Directory.Build.targets injects shared steps, both applying to everything below their folder. No central registry participates.

Outputs follow the same local logic. Binary logs land wherever the -bl flag points, defaulting near the project. Build artifacts fill bin and obj folders inside each project tree. Repos stay reproducible because everything relevant versions with code.

Where MSBuild stores this, by platform

Windows
Directory.Build.props (repo root)

Shared properties and targets discovered by upward walk from projects. Version both files. Binary logs write wherever -bl points.

Linux
Directory.Build.props (repo root)

Same repo relative discovery on all platforms for SDK style projects. Artifacts stay in bin and obj per project.

macOS
Directory.Build.props (repo root)

Mac builds share the identical repo relative layout. No machine global MSBuild config to migrate.

Frequently asked questions

How do I share MSBuild settings across projects?

Place Directory.Build.props at the repo root to flow properties into every project beneath automatically. Targets files inject shared build steps the same way. Keep both versioned since they define the build.

How do I debug MSBuild evaluation?

Pass -bl to MSBuild to write a structured binary log beside the build, then open it in the viewer. Text logs lose structure that binlogs preserve. CI artifacts should keep failing binlogs.

Notice an outdated path? Let us know.