Visual Studio 2010 won't compile/create new projects

2

1

My Visual Studio 2010 Professional with SP1 installed won't compile anymore. The shown error is:

TRACKER : error TRK0005: Failed to locate: "CL.exe". 
The system cannot find the file specified.

Strangely it is also not possible anymore to create new projects - the wizard appears but just restarts when I press create. As I found out the paths for Visual Studio are now built from settings in the registry. Namely HKEY_CURRENT_USER\Software\Microsoft\VisualStudio. Comparing a colleagues installation with mine revealed no different settings. So this is how the Property Pages/Configuration Properties/VC++ Directories look like:

Executable Directories: $(ExecutablePath)
Include Directories: $(IncludePath)
Reference Directories: $(ReferencePath)
Library Directories: $(LibraryPath)
Source Directories: $(SourcePath)
Exclude Directories: $(ExcludePath)

From the Visual Studio 2010 Command Prompt, cl.exe is found.

I can only guess that this behavior was caused by a reinstallation of Studio a couple of months ago (to a different folder). As we use an external build-script for our main project there is a good chance that it is broken since then.

Any hints?

Pascal

Posted 2011-10-05T08:17:47.603

Reputation: 171

Are you sure you installed all the required features? cl.exe is the Visual Studio C/C++ compiler & linker. Make sure you added VC++ support, and not just C# and the other languages. – Breakthrough – 2011-10-05T11:17:35.953

C++ support is added. I doubt that I would see the C++ templates if it was not installed. – Pascal – 2011-10-06T07:27:34.607

Answers

3

Compilation issue

After some further research I found this question on MSDN. The answer from a Microsoft employee contained some tips how to debug your VS installation. Namely:

  • Run as administrator.
  • Start from command line:
    • Devenv.exe /log C:\VS_error.log
    • Devenv.exe /Resetsettings
    • Devenv.exe /ResetSkipPkgs
    • Devenv.exe /Safemode
    • Devenv.exe /Resetsettings
  • Reboot OS to safe mode.
  • Use Process Monitor to see what VS is trying to do.

None of this helped so I went for a repair installation of VS 2010 and SP1 - it didn't help. After that I reset the settings - didn't help. What got me going again is opening Property Pages of my project, then Configuration Properties/General/Platform Toolset. Here are three options listed in my installation:

  • v100
  • v90
  • Windows7.1SDK

The active one was v100 so I switched to v90. With that toolset VS is able to compile again. Obviously this is not a good solution because the 9 compiler is not the latest compiler so this is a mere workaround for my problem.

Project creation issue

The repair install for VS didn't help here either. This stackoverflow question solved a part of the problem. After adding .vbproj and vcproj to HKEY_CURRENT_USER\Software\Classes in the registry, I was able to create Visual Basic and C# projects again. But still I can't create any C++ projects.

Because of the drawbacks of the solution I will not mark my answer as solution to the problem. To me it looks like the registry is messed up and I would appreciate to get to know the source of my problems.

Pascal

Posted 2011-10-05T08:17:47.603

Reputation: 171

1Have you tried a full uninstall/reinstall? – James P – 2012-07-03T08:19:22.887