I recently got the following error when I using the command line to build a Visual Studio 2015 solution that contained a setup project.
ERROR: An error occurred while validating. HRESULT=’8000000A’
In the registry find the key: HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0_Config\MSBuild
If the entry EnableOutOfProcBuild is not in the right pane, then in right pane right click mouse, select New -> DWORD (32-bit) Value and enter EnableOutOfProcBuild and set data value to 0.
For a full explanation go to this link: http://colinsalmcorner.com/post/building-vs-2015-setup-projects-in-team-build
On our local build box I added the entry into the path under HKEY_LOCAL_MACHINE and a couple of entries in the HKEY_USERS before the build worked without any errors.