msbuild.exe staying open, locking files

前端 未结 2 444
后悔当初
后悔当初 2020-12-02 07:53

I use TeamCity which in turn invokes msbuild (.NET 4). I have a strange issue in that after a build is complete (and it doesn\'t seem to matter if it was a successful build

相关标签:
2条回答
  • 2020-12-02 08:15

    Use msbuild with /nr:false.

    Briefly: MSBuild tries to do lots of things to be fast, especially with parallel builds. It will spawn lots of "nodes" - individual msbuild.exe processes that can compile projects, and since processes take a little time to spin up, after the build is done, these processes hang around (by default, for 15 minutes, I think), so that if you happen to build again soon, these nodes can be "reused" and save the process setup cost. But you can disable that behavior by turning off nodeReuse with the aforementioned command-line option.

    See also:

    • MSBuild and ConHost remain in memory after parallel build

    • MSBuild Command-Line Reference

    • Parallel builds that don't lock custom MSBuild task DLLs

    • Node Reuse in MultiProc MSBuild

    0 讨论(0)
  • 2020-12-02 08:39

    To disable node reuse within Visual Studio, you must use an environment variable:

    MSBUILDDISABLENODEREUSE=1
    
    0 讨论(0)
提交回复
热议问题