Reputation: 25281
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 or not), msbuild.exe stays open, and locks one of the files, which means every time TeamCity tries to clear its work directory, it fails, and can't continue.
This happens almost every time.
I'm really lost on this one, so I'll try to provide as much detail as possible.
/m
command-line parameter (which means to use multiple cores)External Tools\Telerik\Telerik.Reporting.Dll
. (There are several other .DLL files included in the External Tools
dir in a similar path structure which never cause this problem). Currently this is with the trial version of Telerik reports, in case that makes any difference.msbuild.exe *32
processes listed in Task manager: I believe there are 7. Using Process Explorer, they all look like top-level processes (no parents). They're all using from 20-50MB ram, and 0.0% CPU. svn:mime-type = application/octet-stream
Has anyone run across this before?
Upvotes: 109
Views: 40886
Reputation: 118865
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:
Upvotes: 135
Reputation: 541
To disable node reuse within Visual Studio, you must use an environment variable:
MSBUILDDISABLENODEREUSE=1
Upvotes: 48