MSBuild & TeamBuild - BuildInParallel failing because of MSB3021 file permission violation

前端 未结 6 2085
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 09:36

I maintain the build of a fairly large piece of software, consisting of roughly 350 csharp projects. Our build time for a debug built clocks in at about 17 minutes.

I h

6条回答
  •  执念已碎
    2021-01-31 10:14

    The default targets that ship with MSBuild are designed for CopyLocal behavior - which is what VS relies on. CopyLocal is problematic when you're outputting to a single output directory.

    To be able to truly build in parallel, you'll need to disable several CopyLocal specific behaviors in the Microsoft.*.Common.*.targets files. I've spoken with some folks in the MSBuild team in the past, and this is a particularly hairy thing to do. Even if you do blank-out some of the CopyLocal behavior, the VS test accessors don't behave well with build in parallel.

    Some of the things you can start with:

    1. Disable CopyLocal behavior for references by setting private to true.
    2. Disable CopyLocal for CopyToOutputPath files when building dependent Projects.

提交回复
热议问题