This article applies to the Windows SDK for Windows Server 2008 and .NET Framework 3.5Problem:  If your usage scenario matches the one listed below, you will be unable to build in the Windows SDK command line build environment.  If you type cl.exe in the SDK command window and press Enter, you will see this error:

 

This application has failed to start because mspdb80.dll was not found.  Re-installing the application may fix this problem.

 

Computer setup required to repro issue:

 

1.       Windows XP on x86 machine (which has version 5.1.2600.2180 of REG.exe)

2.       Visual Studio 2005 installed, but Visual Studio 2008 is NOT installed

 

Cause: When the SDK build environment window is launched, the SDK file SetEnv.cmd launches Reg.exe.  Reg.exe generates standard output when a valid KeyPath is specified and also generates error output when invalid Value is specified.  In this scenario, the KeyPath is valid but the value doesn’t exist:

 

Command:

REG QUERY "%VSRegKeyPath%" /v 9.0

 Output:

! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VC7

 Error:  The system was unable to find the specified registry key or value

 

The second call to REG in setenv.cmd is grabbing the output from the call above and setting VSRoot=VERSION 3.0, which breaks the Windows SDK build environment.  (Other versions of REG.EXE will immediately throw an error when an invalid KeyPath/Value combination is specified.)

 

Workaround: follow these instructions to manually edit SetEnv.cmd to remove the second call to REG:

 

  1. Open up SetEnv.cmd in Notepad or another editor.
  2. For this line:

FOR /F "tokens=2* delims=  " %%A IN ('REG QUERY "%VSRegKeyPath%" /v 9.0') DO SET VSRoot=%%B

Either comment out using the REM command (like this):

REM FOR /F "tokens=2* delims=     " %%A IN ('REG QUERY "%VSRegKeyPath%" /v 9.0') DO SET VSRoot=%%B

 

OR delete the line completely.

  1. Save SetEnv.cmd.
  2. Restart the Windows SDK command prompt.

||Karin Meier||Windows SDK PM||Build Environment.Samples.Community||

 

The MSDN Windows SDK Developer Center is the place to find resources and links to Windows SDK products, release notes, technical articles, and more.