locked
The imported project was not found RRS feed

  • Question

  • Hello, I have similar problem like in this thread or this feedback. After I migrated TFS from 2010 to 2012 Build Controller throws this error:

    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.

    In the C++/CLI project file is this:

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

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

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

    These files are located at:

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110

    Visual Studio Express for Desktop is installed on the same machine where Build Controller runs.

    I know that $(VCTargetsPath) is a Visual Studio template variable, not a environment variable. Anyways declaring the system varible VCTargetsPath pointing to directory where files are did not help.

    Where can I define VCTargetsPath variable?



    Thursday, January 10, 2013 11:22 AM

Answers

  • Hi Vaclav, 

    Thanks for your reply.

    Please ensure the path C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\... is the correct and file existed on your build machine(build agent).

    And you should change all the $(VCTargetsPath) to the file path in your project.

    Not build the project using Team Build, ensure your project can be built using MSBuild command line on build machine first.


    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, January 16, 2013 7:01 AM
    Moderator
  • The problem was that C++/CLI project requires ATL. Visual Studio Express for Windows Desktop doesn't support ATL, so I had to install Professional edition.
    Monday, January 21, 2013 10:04 AM

All replies

  • Hi Vaclav, 

    Thanks for your post.

    What’s the “Build Controller throw this error: ……” mean? In TFS Admin Console>>Build Configuration>>Build Configuration panel?

    Have you installed the VS 2012 Express on build machine? Your Build Controller and Build Agent are the same machine?

    If you received this error in TFS Build log, try the follow steps:

    1        Try to build your project using VS 2012 on build machine, then check the result.

    2        Manually execute the MSBuild v4.0 command line to build your project on build machine, then check the result.

    According the error message, the path “C:\Microsoft.Cpp.Default.props” can not be found, and you said the Microsoft.Cpp.Default.props under path C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110, so please try to the VCTargetsPath = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110 in your project.


    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, January 11, 2013 8:04 AM
    Moderator
  • Hi Vaclav, 

    Have you confirmed that?

    If misunderstood anything, please describe your question in more detail and we will be able to provide the better responses.


    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.

    Monday, January 14, 2013 7:54 AM
    Moderator
  • Hello,

    Build Controller throws the error means that Continuous Integration Build of my branch ran by Build Controller and the build failed.

    I tried add the path C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110 to C++/CLI Project > Properties > Configuration Properties > VC++ Directories > Include Directories, but the build still fails.

    The build succeeds locally, it fails only on TFS.

    please try to the VCTargetsPath = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110 in your project how can I do this?

    Thank you for your help.

    Monday, January 14, 2013 10:08 AM
  • Hi Vaclav, 

    Thanks for your reply.

    TFS invoke MSBuild v4.0 to build project on build machine, so you need to ensure can correctly build your project using MSBuild v4.0 command on build machine, not just build succeeds locally.

    Under Solution Explorer, try to unload your project and edit it, change the <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> to <Import Project="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.props" />.  


    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, January 15, 2013 3:29 AM
    Moderator
  • When I change the path the build controller returns this error:

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

    Tuesday, January 15, 2013 2:50 PM
  • Hi Vaclav, 

    Thanks for your reply.

    Please ensure the path C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\... is the correct and file existed on your build machine(build agent).

    And you should change all the $(VCTargetsPath) to the file path in your project.

    Not build the project using Team Build, ensure your project can be built using MSBuild command line on build machine first.


    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, January 16, 2013 7:01 AM
    Moderator
  • The problem was that C++/CLI project requires ATL. Visual Studio Express for Windows Desktop doesn't support ATL, so I had to install Professional edition.
    Monday, January 21, 2013 10:04 AM