title: MSBuild "sgen.exe" is missing
body: <p>I'm getting the following error when using MSBuild. The error I am getting is:</p>
  
  <blockquote>
    <p>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2769,5):
    error MSB3086: Task could not find "sgen.exe" using the SdkToolsPath
    "" or the  registry key
    "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.
    0A\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the
    tool exi sts in the correct processor specific location under the
    SdkToolsPath and that the Microsoft Windows SDK is installed</p>
  </blockquote>
  
  <p>So far I have done the following:</p>
  
  <p>1) Install Windows SDK v8 from <a href="https://msdn.microsoft.com/en-US/windows/desktop/hh852363.aspx" rel="noreferrer">here</a></p>
  
  <p>2) I confirmed that the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8. 0A\WinSDK-NetFx40Tools-x86" exists in the registry</p>
  
  <p>3) The registry key from 2 above points to the path "C:\Program Files\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools" and I have confirmed that the path exists and that sgen.exe is located in that directory</p>
  
  <p>4) I have also did some of my own research and came across <a href="https://stackoverflow.com/questions/2731365/running-msbuild-fails-to-read-sdktoolspath">this SO post</a> but the answer involves installing visual studio on the server itself which is NOT an option for me. However I do want to point out that I have another build server with the exact same setup and it's working fine so my temporary work around is to build it on that server and then copy the build over.</p>
  
  <p>Anyone have any insight on what the problem might be?</p>