I was able to find several similar questions asked and answered, but none of the answers or exact conditions applied to my situation.
This error also pops up on a build machine after installing MSBuild Toolset (for Visual Studio 2013). The problem is that only the 32bit version of sgen.exe is available by default.
The problem disappears after installing the latest Windows SDK which includes the 64Bit version of sgen.exe:
http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx
On one agent (machine) I needed to install the older version as well:
http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx