【发布时间】:2018-09-25 03:53:04
【问题描述】:
我正在使用 TFS2018 api 将源映射从我的 XAML 构建定义复制到新的构建定义。我有以下代码
var def = defs.FirstOrDefault(d => d.Name == xamlDef.Name);
if (def != null)
{
var json = JsonConvert.SerializeObject(mappings);
var tfvs = json.Replace("$(SourceDir)", "");
def.Repository.Properties["tfvcMapping"] = tfvs;
using (var buildClient = new BuildHttpClient(uri, cred))
{
var t = buildClient.UpdateDefinitionAsync(def, teamProject);
var result = t.Result;
}
}
tfvs 变量包含以下字符串
{"mappings":[{"serverPath":"$/Utils/TestQueue","mappingType":"map","localPath":"\Utils\TestQueue"},{"serverPath":"$/MyTeamProject/ProjectA","mappingType":"map","localPath":"\MyTeamProject\ProjectA"}]}
我更新后源映射不存在。如果我查看构建定义,它只包含以下字符串
{[tfvcMapping, {"mappings":[{"serverPath":"$/MyTeamProject","mappingType":"map","localPath":"\\"}]}]}
tfvcMapping 字符串不正确吗?是否可能无法使用 tfs api 更新源映射?
【问题讨论】:
标签: tfs