Problem Description:
while trying to build a win32 console project from visual studio 2008, the error message is “fatal error C1902: Program database manager mismatch; please check your installation”
I decided to use WinDbg to find the root cause.
Steps to Debug
1. Since this fails during compilation, so we have to attach WinDbg to “cl.exe”and since visual studio 2008 is launching cl.exe so you have to auto-attach it (you can directly execute cl.exe)
2. In order to auto-attach a process to debugger, you can use “gflags.exe”(exists in WinDbg installation folder)
3. See the snapshot below on how to use gflags to auto attach to a process cl.exe when launched
4. Build your project and you will see WinDbg getting launched and attached to cl.exe
5. hit f5 and execute getlasterror command to see the details when stopped on exception
0:000> !gle
LastErrorValue: (Win32) 0 (0) – The operation completed successfully.
LastStatusValue: (NTSTATUS) 0xc0000135 – {Unable To Locate Component} This application has failed to start because %hs was not found. Re-installing the application may fix this problem.
6. Below is the loader message matching the last error description
LDR: LdrGetDllHandle, searching for C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\mspdbsrv.exe from ……
kLDR: LdrpCheckForLoadedDll – Unable To Locate C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\mspdbsrv.exe ……………..
7. Basically, build is failing because cl.exe(compiler) can’t find mspdbsrv.exe for symbols.
You can copy exe in the path(C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\) or change the registry to point to the correct location. It appears that visual studio 2005 upgrade may have caused this issue.

Hammadi says:
Thank you for this interesting information
[Reply]
Brian says:
Thanks, tried this, now I’m faced with a completely new set of errors with cl.exe and it won’t even open after uninstalling windbg and reinstalling VS2008, and then a completely new copy of VS2010..
[Reply]
prashant Reply:
July 14th, 2011 at 11:21 am
@Brian, What is the error?
[Reply]