VCTargetsPath is wrong when building with MSBuild on build server

后端 未结 2 896
無奈伤痛
無奈伤痛 2020-12-16 03:20

In my C++ project, Test.wcxproj, I have the following configurations defined:




        
相关标签:
2条回答
  • 2020-12-16 03:32

    Try to set up environment variable

    VisualStudioVersion=12.0
    

    or pass it explicitly as property to msbuild on commandline

    msbuild.exe <project or solution to build> /p:VisualStudioVersion=12.0
    

    I think it is because Microsoft tries to keep compatibility with older Visual Studios.

    see Visual Studio project compatibility and VisualStudioVersion

    0 讨论(0)
  • 2020-12-16 03:32

    In my case, my build definition was configured to build my .sln file instead of my .proj file. I remember configuring it to build the MSBuild project, but somehow it seems to have reverted to the Solution.

    Anyway, I found two solutions to the problem:

    1. Make sure to build the .proj file (where the tools version is indeed set to 12.0).
    2. Explicitly set the VCTargetsPath.
    0 讨论(0)
提交回复
热议问题