none
Why does MSBuild look for "v110" directory for the "Microsoft.Cpp.Default.props" file with VS2013? RRS feed

  • Question

  • Hi,

    I have a VC++ project that builds successfully both with VS2010 SP1 and with MSBuild. I installed the VS2013 into the same machine and opened the project with it. VS2013 converted the project from VS2010 to VS2013. The project built successfully with VS2013. However, when I ran MSBuild, it output the following error message - "error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found."

    I verified that there was no such directory with "V110" on my computer. Instead, my machine has "V120" directory in which the specified file exists. The vcxproj file does have "<PlatformToolset>v120</PlatformToolset>" for both Debug and Release conditions. Note that I completely skipped installing VS2012.

    Question: How can I let the MSBuild look for the "V120" directory?


    tetsu


    • Edited by tetsu1 Friday, October 25, 2013 8:14 PM
    • Moved by Cece Dong Monday, October 28, 2013 6:02 AM the case belongs to MSBuild
    Friday, October 25, 2013 7:21 PM

Answers

  • tetsu,

    I had the same issue with TFS Team Build. You simply need to change the MSBuild command line arguments being passed from your build configuration. Include the following command line property in any parameters you're passing in:

    Steps to fix (in TFS 2012):

    1) Edit the build definition for the build.

    2) Click the process tab.

    3) In the Advanced section, set the MSBuild Arguments to include the following property:

    /p:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120"

    4) Save the build definition.

    This will fix the issue, and get MSBuild to use the correct version of the C++ targets.

    Hope that helps!

    Jeff

    • Marked as answer by tetsu1 Monday, October 28, 2013 12:20 PM
    Saturday, October 26, 2013 9:59 PM

All replies

  • tetsu,

    I had the same issue with TFS Team Build. You simply need to change the MSBuild command line arguments being passed from your build configuration. Include the following command line property in any parameters you're passing in:

    Steps to fix (in TFS 2012):

    1) Edit the build definition for the build.

    2) Click the process tab.

    3) In the Advanced section, set the MSBuild Arguments to include the following property:

    /p:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120"

    4) Save the build definition.

    This will fix the issue, and get MSBuild to use the correct version of the C++ targets.

    Hope that helps!

    Jeff

    • Marked as answer by tetsu1 Monday, October 28, 2013 12:20 PM
    Saturday, October 26, 2013 9:59 PM
  • Hi tetsu1,

    Thanks for your post.

    Since the issue is related to MSBuild, I'm going to move it to MSBuild forum for better response.

    Thanks for your understanding.

    Best regards,

    Cece


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 28, 2013 6:02 AM
  • Hello,

    >>Question: How can I let the MSBuild look for the "V120" directory?

    Please try  /p:PlatformToolset=v120 and then  /t:rebuild on the command line.For more details, please refer to Using MSBuild with a Different Toolset in Walkthrough: Using MSBuild to Create a Visual C++ Project .

    In addition,you could use the /verbosity:diagnostic in the command line to display detailed message in the build log.For more information,please refer to MSBuild Command-Line Reference.

    Best Regards,

    Jane.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 28, 2013 9:40 AM
  • Hi Jeff,

    Adding /p:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120" to the MSBuild command line worked. On the other hand, adding /p:PlatformToolset=v120 did not work.

    Thanks for your help. I really appreciate it.


    tetsu

    Monday, October 28, 2013 12:20 PM
  • NO. But this DID work : /p:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V12.0/"

    So adding an extra "/" to the path did work. Do not append a "\", because that will cause MSBuild to fail terribly with an invalid command line switch error "-" ( @#$! :-( ) . But the extra '/' is just enough to 'fool' MSBuild into using the correct directory.


    Friday, April 4, 2014 12:27 PM