Visual Studio 2012, Windows SDK v8.0a, TFS build agent and VC++ rc.exe RRS feed

  • Question

  • This isn't a current problem, as I was able to fix this issue.. But I do have a couple questions at the end..

    We're in the process of upgrading our Visual Studio installations to Visual Studio 2012, from 2010.. Installation worked fine, and all our solutions (not upgraded to 2012) build just fine within vs2012..

    We're also prototyping switching our c++ unit tests from the C++/CLI to the Native unit tests available in 2012.. That was also working with no problems (so far)..

    We have a TFS 2010 server still (few months before that gets converted over), and in order to try and get the Native Unit Test projects building on our CI build agent, I installed VS2012 on the build agent's server..

    The moment that happened, every one of our CI builds failed, with the given error:

    TRACKER: Failed to locate: "rc.exe". The system cannot find the file specified.

    Digging deeper, I find that the resource compiler (rc.exe) is located in the Windows SDK directory, which is included by VC's $(WindowsSDKDir) environment variable.  Within VS2012, this directory points to "%programfiles%\Microsoft SDKs\Windows\v7.0A\bin" directory.. however in the build agent this directory is "%programfiles%\Microsoft SDKs\Windows\v8.0A\bin"..  

    The v7.0A SDK contains rc.exe, while the v8.0 SDK does not.. I know that installing VS2012 also installs the Windows SDK (v8.0A), but doesn't explain why the build agent is using a different path than Visual Studio itself.

    Digging even deeper.. I find that the $(WindowsSDKDir) is pulled from the registry; for a 32-bit program (which Visual Studio is) the regkey is stored in the 32-bit hive (on a 64-bit machine), here:

    HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows

    in the "CurrentInstallFolder" path; the value points to the v7.0A SDK.. So VS2012 will use this path to build (and reference) the SDK directory.

    However the build agent (TFSBuildServiceHost.exe) on the machine is a 64-bit program, which references the 64-bit key (same as above without the Wow6432Node):

    HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows

    The "CurrentInstallFolder" value holds the v8.0A SDK, which does not contain rc.exe.. Thus the Build Agents fail.

    The fix was to change the 64-bit key point to the v7.0A SDK; after that all CI builds work.. However this raises a couple questions...

      • Was not including rc.exe in the v8.0A SDK an oversight, or on purpose?? If so, why?
      • Why does the VS2012 install of the v8.0A SDK change the 64-bit registry key for install location but not the 32-bit registry key?

    or am I missing something entirely??

    Wednesday, October 17, 2012 9:31 PM


  • rc.exe was not included on purpose, it's stated here:

    "The Windows SDK no longer ships with a complete command-line build environment."

    The main reason, I think, is that main development language for Windows is now C#, not C++ and .NET tools are actually included, so I think it's just further move from C++ towards .NET

    Thursday, October 18, 2012 5:27 AM