dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.19k stars 1.35k forks source link

[Built-in analyzer] Multiple projects share the same obj/bin #9879

Closed ladipro closed 2 weeks ago

ladipro commented 4 months ago

Background

This issue tracks one of the BuildCheck analyzers we would like to ship in-box with MSBuild.

Goal

Implement an analyzer with the following rule: No two projects should have the same OutputPath or IntermediateOutputPath.

Notes

Using a shared directory for outputs or intermediates often leads to file access issues and non-deterministic builds.

YuliiaKovalova commented 2 months ago

It was implemented as a part of infra: https://github.com/dotnet/msbuild/pull/9735/files#diff-c0ff124955ad434ec4f985b7dc4366f5efa4d0794699cdb0260db5d84492129f

I am checking for the false positives reported...