How to build a VS2010 MakeFile project (vcxproj) with TFS Build (No VS 2010)

前端 未结 4 632
刺人心
刺人心 2020-12-10 03:17

I have a project that was building fine in VS 2008, and then we installed and started using TFS Build, and then we upgraded to TFS 2010. Everything was still fine and build

4条回答
  •  萌比男神i
    2020-12-10 03:47

    I have devised a somewhat complex, but functional work around involving the following steps.

    1. Copy these files from C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0 on a system where VS2010 is installed -- check them into source control so they are retrieved as part of the workspace:
      • Microsoft.Build.CPPTasks.Common.dll
      • Microsoft.BuildSteps.targets
      • Microsoft.Cl.Common.props
      • Microsoft.Cpp.Default.props
      • Microsoft.Cpp.props
      • Microsoft.Cpp.targets
      • Microsoft.CppBuild.targets
      • Microsoft.CppCommon.targets
      • Microsoft.Link.Common.props
      • Microsoft.MakeFile.targets
      • Platforms\Win32\Microsoft.Cpp.Win32.default.props
      • Platforms\Win32\Microsoft.Cpp.Win32.props
      • Platfotms\Win32\Microsoft.Cpp.Win32.targets
    2. Change the vcxproj file to refer to the relative path where the workspace puts those files instead of $(VCTargetsPath).
    3. Change lines (in all those files) to use attribute AssemblyFile="Microsoft.Build.CPPTasks.Common.dll" instead of referring to this using the AsssemblyName attribute.
    4. Delete "$(VCTargetsPath)\" in the files at the root of the new location so that it finds its sibling files instead of trying to refer to the non-existent VCTargetsPath macro. You can find instances that you missed by trying to run a command line build with MSBuild on the machine without VS 2010 and looking at the error messages.
    5. Similarly replace $(VCTargetsPath) in child directory files with relative paths.
    6. At the end of the file Microsoft.Cpp.Win32.targets, comment out the "" line and the following related .
    7. Trial and error, run command line build and see what else I may have forgotten to mention. I think that was most of it.

提交回复
热议问题