Error: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found

StackOverflow https://stackoverflow.com/questions/22229548

Question

I have migrated a VS2008 solution to VS2013. My solution contains VC++ projets. I have set the tools platform to v120_xp for each project My solution compile on my computer and compile on my builds server in VS2013 My builds server is a Windows2008 R2 with VS2008, VS2010 and VS2013 and a build controler of TeamFoundationServer 2010.

When i launch the build with the build controller, the build fails with :

The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

In the V110 directory this file doesn't exist but it exist in the V120 directory. I have checked the registry : HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersion\12.0 the VCTargetPath are corrects

Have you an idea to help me?

Was it helpful?

Solution

I have edited the registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\12.0\11.0

and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0\11.0

to use the V120 directory

Now my server build the solution, but i don't understand why MSBuild use the key ToolsVersions\12.0\11.0 and not the key ToolsVersions\12.0\12.0 Parhaps it's due to the v120_xp platform toolset

OTHER TIPS

The true answer is that MSBuild subtracts 1 from the .sln Visual Studio Version. Since you do not have VS 2012 install or you have not installed it, the v11.0 folder is not found. It is all explained by Sayed Ibrahim Hashimi:

http://sedodream.com/PermaLink%2cguid%2ca5894bad-f2a1-441a-a5b2-74f16c6cf8aa.aspx

I came across the same problem in 2015 though, with Windows 10 and Visual Studio 2015 RC (fresh install)

To correct the issue I tried several solutions based on my research ie installing "VS Windows SDK" which didn't do anything different to resolve my problem, I then on another recommendation installed GitHub in order to download MSBuild which is now excluded from VS, I ultimately downloaded and installed "VS Tools for Windows 10" this didn't give me the same error in the end, without having to change registry keys

Installing VS 2012 on your build server should create the necessary targets files for you.

I was able to get past this by changing $(VCTargetsPath) to $(VCTargetsPath12) in the project file.

This feels like a temporary workaround rather than a permanent solution, since once we move to the next version of Visual Studio we'll have to find all the references to $(VCTargetsPath12) and replace with the new target path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top