I have a project created in Visual Studio, 2013.
The project file has the following properties:
ToolsVersion="12.0",
PlatformToolset = v120.
I have Visual Studio 2013 and Microsoft Build Tools 2015 installed.
This project gets successfully built using MSBuild 12.0. Upon the attempt to build it with MSBuild 14.0 I get an error
MSB4019: The imported project "C:Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
As I understand, the problem is that the variable VCTargetsPath doesn’t get evaluated. If I specify the variable VCTargetsPath before the build (with the value C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V120), the problem is solved.
However, this approach is not very convenient in case the path is different. Is it possible to somehow solve the problem in a more optimal way?
The registry key and its value:
HKLMSoftwareWOW6432NodeMicrosoftMSBuildToolsVersions12.0VCTargetsPath $([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)Microsoft.Cppv4.0V120'))
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…