Permanent solution (+ for assembly machines)
Visual studio 2017
For VS 2017, call the following CMD scripts under your target Windows account:
Public Edition
Professional Edition
Corporate Edition
TL; DR. Notes for the bad DisableOutOfProcBuild.exe , Microsoft has proposed a solution that I use for VS 2017.
DisableOutOfProcBuild.exe does not assume that you DisableOutOfProcBuild.exe it from the installation folder . Therefore, you cannot copy this .exe file. (By the way, if you want to build .vdproj, you have to install VS.)DisableOutOfProcBuild.exe will work only if the installation directory DisableOutOfProcBuild.exe is specified in the current CMD directory.
For example, for VS Professional Edition we should call
CD "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild" CALL DisableOutOfProcBuild.exe
Visual Studio 2015 and earlier
CMD for the current Windows user
For many people, creating / fixing in HKEY_CURRENT_USER\.. does not always work or works all the time.
Trying to solve this problem, I found that I actually need to create / modify some strange key in HKEY_USERS HKEY_USERS\S-1-5-xx-xxxxxxxxxx-xxxxxxxxx-xxxxxxxxxxx-xxxxx\...\MSBuild
But I also found that if I use the CMD console for HKCU with the proposed fix
REG ADD HKCU\SOFTWARE\Microsoft\VisualStudio\14.0_Config\MSBuild/t REG_DWORD/v EnableOutOfProcBuild/d 0/f
this will write the value to this strange key HKEY_USERS \ S-1-5-xx-xxxxxxxxxx-xx ... , and not to HKEY_CURRENT_USER .
So, it works the first time and forever. Just use the CMD console.
REG ADD HKCU\SOFTWARE\Microsoft\VisualStudio\14.0_Config\MSBuild /t REG_DWORD /v EnableOutOfProcBuild /d 0 /f @REM (use 12.0_Config for VS2013)
Solver for build servers
On the other hand, this code always works for the current user account that runs it (due to HKEY_CURRENT_USER). But build servers often use dedicated accounts or a local system, etc.
I fixed this on my build machines by adding the following simple batch file to my build tasks (Jenkins, TeamCity, CruiseControl)
VS-2015 , VS-2013 , VS-2017-Community , VS-2017-Professional , VS-2017-Enterprise