从msbuild启用项目

时间:2016-11-03 15:55:25

标签: tfs msbuild

有没有办法从msbuild按需启用项目?

我有这些禁用的项目,我喜欢在构建服务器上一夜之间构建。

>  msbuild solution.sln /t:Common.Test /p:Configuraion="Release" /p:Platform="x64"
    Microsoft (R) Build Engine version 12.0.40629.0
    [Microsoft .NET Framework, version 4.0.30319.42000]
    Copyright (C) Microsoft Corporation. All rights reserved.

    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    Build started 03/11/2016 16:31:10.
    Project "soluton.sln" on node 1 (Common.Test target(s)).
    ValidateSolutionConfiguration:
      Building solution configuration "Debug|x64".
    ValidateProjects:
      The project "Common.Test" is not selected for building in solution configuration "Debug|x64".
    solution.sln.metaproj : error MSB4057: The target "Common.Test" does not exist in the project. [solution.sln]
    Done Building Project "solution.sln" (Common.Test target(s)) -- FAILED.


    Build FAILED.

    "solution.sln" (Common.Test target) (1) ->
      solution.sln.metaproj : error MSB4057: The target "Common.Test" does not exist in the project. [solution.sln]

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.04

这是来自VS2013,但我想在Team Foundation Server 2015构建定义中启用它。

1 个答案:

答案 0 :(得分:0)

在TFS Build定义中,您可以指定要在MSBuild任务中构建的项目:

enter image description here

您可以在您喜欢的时间触发预定的构建:

enter image description here