小编Kir*_*ran的帖子

TFS Build 2.0 C#,如何向 build/Pass Msbuild args 添加变量

我正在尝试将参数传递给 MSBuild 2.0。经过研究,似乎我需要使用变量来执行此操作,但我无法弄清楚如何将其合并到下面的队列请求中。我试过参数,但这似乎不起作用。这是我想告诉 MSBuild @" /p:OctoPackPackageVersion=" + releaseNumber. 这适用于使用 IBuildRequest.ProcessParameters 的 XAML 构建。

var buildClient = new BuildHttpClient(new Uri(collectionURL), new 
VssCredentials(true));
var res = await buildClient.QueueBuildAsync(new Build
            {
                Definition = new DefinitionReference
                {
                    Id = targetBuild.Id
                },
                Project = targetBuild.Project,
                SourceVersion = ChangeSetNumber,
                Parameters = buildArg

            });
            return res.Id.ToString();
Run Code Online (Sandbox Code Playgroud)

tfs build tfs-2015

5
推荐指数
1
解决办法
1489
查看次数

标签 统计

build ×1

tfs ×1

tfs-2015 ×1