Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用TFS API,如何使用TFS API修改现有变更集注释_Api_Tfs - Fatal编程技术网

使用TFS API,如何使用TFS API修改现有变更集注释

使用TFS API,如何使用TFS API修改现有变更集注释,api,tfs,Api,Tfs,如何使用API修改现有更改集注释? 使用Visual Studio,可以在“变更集详细信息”窗口中通过更改注释并单击“保存”来完成此操作。 如何使用API完成此操作?您需要运行以下代码: TeamFoundationServer tfs = new TeamFoundationServer(new Uri("http://tfsservername:8080/tfs/DefaultCollection")); VersionControlServer vcServer = (VersionCon

如何使用API修改现有更改集注释? 使用Visual Studio,可以在“变更集详细信息”窗口中通过更改注释并单击“保存”来完成此操作。
如何使用API完成此操作?

您需要运行以下代码:

TeamFoundationServer tfs = new TeamFoundationServer(new Uri("http://tfsservername:8080/tfs/DefaultCollection"));
VersionControlServer vcServer = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
Changeset changeset = vcServer.GetChangeset(changesetid);
changeset.Comment = changeset.Comment + Environment.NewLine + "your comment";
changeset.Update();