This project has moved. For the latest updates, please go here.


process hangs


sample build call;
$buildSucceeded = Invoke-MsBuild -Path $slnPath -MsBuildParameters "/target:Clean;Build /verbosity:minimal /maxcpucount /property:BuildInParallel=true" -AutoLaunchBuildLog -ShowBuildWindow -KeepBuildLogOnSuccessfulBuilds -BuildLogDirectoryPath "PathDirectory"
Occasionally when building the msbuild window would close (and finish building) however the cmd.exe subprocess wouldn't exit

Windows 7 Enterprise x64
Powershell v3.0
C:\Program Files (x86)\Microsoft Visual Studio 11.0>msbuild /version
Microsoft (R) Build Engine version 4.0.30319.18408

The below patch fixed it for me

file attachments

Closed Apr 15, 2016 at 4:01 PM by deadlydog
Ok, I believe this issue should be fixed as of v1.6.3 of the PowerShell Module. Closing as fixed.


mantzas wrote Aug 12, 2014 at 12:11 PM

i am using the /m switch for parallel build.

wissen wrote Sep 24, 2014 at 5:42 PM

When you additionally use /nr:false it should help.

deadlydog wrote Apr 14, 2016 at 3:03 AM

I'm curious, is anybody still experiencing this problem with v1.6.3 or greater of Invoke-MsBuild?

kumg wrote Apr 15, 2016 at 2:20 PM

Yes, I don't know exactly what is happening, but I have a loop that run the MsBuild for each solution in a folder, and sometimes, It takes exactly 10 minutes to build each solutions. (I added

It tried to use /nr:false and the fix from the reporter, but it still doesn't work... (I added "Write-Verbose "Cmd process end."" just after the Start-Process command...

16:05:05 : VERBOSE: Starting new cmd.exe process with arguments "/k " "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" & msbuild "C:\myFolder\mySolution.sln" /nr:false /fileLoggerParameters:LogFile="C:\myFolder\mySolution.sln.msbuild.log" & Exit" ".

16:15:11 : VERBOSE: Cmd process end.

kumg wrote Apr 15, 2016 at 2:36 PM

Oh sorry I didn't see the last version. I was still using the v1.6.1.

The problem seems to be solved. Thank you very much!