none
Build failure after installing TFS 2013 Preview: The imported project "C:\Microsoft.Cpp.Default.props" was not found.

    Question

  • Hello,

    My VS 2012 C++ projects fail to build since I upgraded TFS 2012 to TFS 2013 Preview. I get the following build error:

    C:\Builds\1\Base\Base\Sources\Utils\Utils.vcxproj (39): 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.

    That error points to the following project file line:

    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

    I have VS 2012 Update 3 installed on the build machine. I tried repairing the installation but it didn't solve the problem. What else can I do to fix it?

    Thank you.


    Ricardo Costa

    Wednesday, July 24, 2013 7:05 AM

Answers

All replies

  • Hi Ricardo, 

    Thanks for your post.

    The build issue only happened in your VS 2012 C++ projects? Other type of projects build fine using TFS 2013 Preview Build  Service?

    Please provide the detailed TFS build log here.

    On your build agent machine, try to build your VS 2012 C++ project using MSBuild command line manually, then check the result.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, July 25, 2013 3:23 AM
  • Hi John,

    I haven't tested other project types or projects created with other versions of VS because I only use VS 2012 currently.

    Building from the command line (i.e. running MSBuild.exe C:\Builds\1\Base\Base\Sources\Base.sln) works without problems. The problem happens with Team Builds only, both automatic and manually queued.

    Here is the full log file generated by a failed build:

    ---

    Build started 7/24/2013 4:11:39 AM.
         1>Project "C:\Builds\1\Base\Base\Sources\Base.sln" on node 1 (default targets).
         1>ValidateSolutionConfiguration:
             Building solution configuration "Debug|Win32".
         1>Project "C:\Builds\1\Base\Base\Sources\Base.sln" (1) is building "C:\Builds\1\Base\Base\Sources\DataStructures\DataStructures.vcxproj.metaproj" (2) on node 1 (default targets).
         2>Project "C:\Builds\1\Base\Base\Sources\DataStructures\DataStructures.vcxproj.metaproj" (2) is building "C:\Builds\1\Base\Base\Sources\Utils\Utils.vcxproj" (3) on node 1 (default targets).
         3>C:\Builds\1\Base\Base\Sources\Utils\Utils.vcxproj(39,3): 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.
         3>Done Building Project "C:\Builds\1\Base\Base\Sources\Utils\Utils.vcxproj" (default targets) -- FAILED.
         2>Done Building Project "C:\Builds\1\Base\Base\Sources\DataStructures\DataStructures.vcxproj.metaproj" (default targets) -- FAILED.
         1>Done Building Project "C:\Builds\1\Base\Base\Sources\Base.sln" (default targets) -- FAILED.

    Build FAILED.

           "C:\Builds\1\Base\Base\Sources\Base.sln" (default target) (1) ->
           "C:\Builds\1\Base\Base\Sources\DataStructures\DataStructures.vcxproj.metaproj" (default target) (2) ->
           "C:\Builds\1\Base\Base\Sources\Utils\Utils.vcxproj" (default target) (3) ->
             C:\Builds\1\Base\Base\Sources\Utils\Utils.vcxproj(39,3): 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.

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.56

    ---

    Thank you.


    Ricardo Costa


    • Edited by RicarDog Thursday, July 25, 2013 5:18 AM made text clearer
    Thursday, July 25, 2013 5:05 AM
  • Hi Ricardo, 

    Thanks for your reply.

    “Other type of projects” I mean other VS 2012 project types, like VS 2012 C# Console Application.

    You said that “Building from the command line works without problems”, you run the MSBuild command line on build agent machine to build your C++ project?

    As we know that TFS will invoke MSBuild to build project on build agent machine. According the error message: MSB4019: The imported project “C:\Microsoft.Cpp.Default.props” was not found, please check this project on build agent machine manually, ensure it existed or not.

    Additionally, TFS 2012 build this same C++ project without any issue?(before you upgrade to TFS 2013)


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 26, 2013 2:31 AM
  • Hi Ricardo,

    Have you tested that?


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 30, 2013 2:15 PM
  • “Other type of projects” I mean other VS 2012 project types, like VS 2012 C# Console Application.

    Just tested a C# project and it builds fine, so the problem is specific to C++ projects.

    You said that “Building from the command line works without problems”, you run the MSBuild command line on build agent machine to build your C++ project?

    Yes, I've run it from the command line on the agent machine, although I didn't use the build agent account (NETWORK SERVICE), but instead a domain administrator account.

    As we know that TFS will invoke MSBuild to build project on build agent machine. According the error message: MSB4019: The imported project “C:\Microsoft.Cpp.Default.props” was not found, please check this project on build agent machine manually, ensure it existed or not.

    It doesn't exist there, but it exists in the folder "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110". I suppose the $(VCTargetsPath) variable that I mentioned on the first post should point there but is instead being replaced as "C:\", and that is causing the build error.

    Additionally, TFS 2012 build this same C++ project without any issue?(before you upgrade to TFS 2013)

    Yes, the problem started after the upgrade.

    Thank you.


    Ricardo Costa

    Wednesday, July 31, 2013 2:04 AM
  • Hi Ricardo, 

    Thanks for your reply.

    According your description: but it exists in the folder “C:\Program Files(x86)\MSBuild\...”, your build agent machine is 64-bit, so please open Registry Editor on your build agent machine, and check the VCTargetsPath value under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\4.0\11.0, the value for VCTargetsPath should be '$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\v110\', and this $(MSBuildExtensionsPath32) is mean “C:\Program Files (x86)\MSBuild” on your 64-bit build machine, for more information about $(MSBuildExtensionsPath32), please refer to this document: http://msdn.microsoft.com/en-us/library/ms164309(v=vs.110).aspx.

    If the value of VCTargetsPath set correctly in Registry Editor, but you still received this issue when build your C++ project using TFS 2013 Preview, please submit it to Microsoft Connect Feedback portal at: https://connect.microsoft.com/VisualStudio. Microsoft engineers will evaluate them seriously.

    Additionally, try create new simplest C++ project in your TFS 2013 Preview, then create a new build definition to build it, and check the result.

    And you can try this workaround: create a new system environment variable VCTargetsPath = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v110\ on build agent machine.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 31, 2013 7:09 AM
  • Hi John,

    My VCTargetsPath is a bit different from what you said but seems OK:

    $([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\v110\'))

    How is the value of MSBuildExtensionsPath32 set? There is no registry key for it. Anyway, it seems that if the problem were with MSBuildExtensionsPath32, I think the error would contain something like C:\Microsoft.Cpp\v4.0\v110\Microsoft.Cpp.Default.props instead. Should I report the issue with VCTargetsPath on Connect?

    I created a new empty console project with a new default build definition but the same error happened.

    I'll try the workaround that you mentioned in the meantime.

    Thank you.


    Ricardo Costa




    • Edited by RicarDog Wednesday, July 31, 2013 9:21 AM added more info
    Wednesday, July 31, 2013 9:12 AM
  • I've submitted a go-live support request on Connect as you suggested. Thanks.

    Ricardo Costa

    Wednesday, July 31, 2013 9:50 AM
  • Hi Ricardo,

    Thanks for your reply.

    Please share your feedback link here, we will tracking the replies in it.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 31, 2013 9:53 AM
  • Ricardo and I worked this issue offline and found that installing a full copy of VS 2013 and VS 2012 on his build controller\agent (TFS 2012 upgraded to TFS 2013) resolved this issue.

    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.

    Thursday, August 15, 2013 2:19 PM
  • Hi Guys,

    I have exactly the same problem ?

    How did you mange to solve it ? I installed VS 2012 on my machine but TFS and build system is TFS 2013?

    Please help.


    CM Consultant

    Monday, December 23, 2013 2:08 PM