none
build.proj file does not work with VS17 community edition RRS feed

  • Question

  • Below is the start of my build file
    It just doesn't work with Visual Studio 2017 Community edition.

    1) What is the correct value for $(VCTargetsPath)

    2) How do I tell this to my build.proj file?

    <?xml version="1.0" encoding="utf-8"?>
    <Project
            DefaultTargets="Build"
            ToolsVersion="4.5"
            xmlns="http://schemas.microsoft.com/developer/msbuild/2003">


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

                
    Sunday, February 17, 2019 2:51 AM

Answers

  • Hi Chris,

    Welcome to MSDN forum.

    >> 1) What is the correct value for $(VCTargetsPath)

    You can find the values of $(VCTargetsPath) in your machine by Marcos.

    In VS2017, open a C++ project, right-click project->properties, choose Target Name, in the drop-down list choose “edit”, Then choose “Marcos” you can find the paths like below:


    The top is default VCTargetsPath in VS2017. And others refer to earlier versions of VC. So the correct value of it depends on what vs version this project comes from. For example: If it once builds well in VS2012, then the value of $(VCTargetsPath11) should be the value you want.

    >> How do I tell this to my build.proj file?

    Add markup to vcxproj file like below if you use VS IDE to build:

    <PropertyGroup>
    
        <VCTargetsPath>EnterThePathHere</VCTargetsPath>
    
    </PropertyGroup>

    Or use command like this if you use msbuild: 

    msbuild xxx.vcxproj /p:VCTargetsPath="C:\xxx\xxx\xxx"

    In addition: Since the tool version of project is 4.5, which indicates it comes from a much earlier vc version. It may occur compatibility issues when we compile it. So it could be better if you can share detailed error message here.

    Hope all above can help solve your issue. Look forward to your reply!

    Best Regards

    Lance 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, February 19, 2019 7:01 AM

All replies

  • Hi Chris,

    Welcome to MSDN forum.

    >> 1) What is the correct value for $(VCTargetsPath)

    You can find the values of $(VCTargetsPath) in your machine by Marcos.

    In VS2017, open a C++ project, right-click project->properties, choose Target Name, in the drop-down list choose “edit”, Then choose “Marcos” you can find the paths like below:


    The top is default VCTargetsPath in VS2017. And others refer to earlier versions of VC. So the correct value of it depends on what vs version this project comes from. For example: If it once builds well in VS2012, then the value of $(VCTargetsPath11) should be the value you want.

    >> How do I tell this to my build.proj file?

    Add markup to vcxproj file like below if you use VS IDE to build:

    <PropertyGroup>
    
        <VCTargetsPath>EnterThePathHere</VCTargetsPath>
    
    </PropertyGroup>

    Or use command like this if you use msbuild: 

    msbuild xxx.vcxproj /p:VCTargetsPath="C:\xxx\xxx\xxx"

    In addition: Since the tool version of project is 4.5, which indicates it comes from a much earlier vc version. It may occur compatibility issues when we compile it. So it could be better if you can share detailed error message here.

    Hope all above can help solve your issue. Look forward to your reply!

    Best Regards

    Lance 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, February 19, 2019 7:01 AM
  • I finally got to it.
    My machine had 7 different VCTargetsPath.  I tried them all.  The last one I tried did work.
    Thank you a lot.

    Chris

    Sunday, July 21, 2019 5:14 AM