我正在使用TFS API连接到Team Foundation Server.在服务器URI中,我传递服务器的主机名.我收到错误的URI格式错误.
teamFoundationServer = new TfsTeamProjectCollection(new Uri(this.Server,UriKind.Absolute),this.Credentials); teamFoundationServer.EnsureAuthenticated();
我正在尝试以编程方式更新测试用例的区域。
我的代码似乎合乎逻辑,但是失败了:
Microsoft.TeamFoundation.WorkItemTracking.Client.dll中发生了类型为'Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException'的未处理异常
附加信息:TF400276:您试图为未打开或部分打开的工作项的字段设置值。您无法为未打开或未部分打开的工作项的字段设置值。
这是代码:
private static void Main(string[] args)
{
TeamProjectPicker tpp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
tpp.ShowDialog();
var tc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(
tfsUri,
new UICredentialsProvider());
tc.EnsureAuthenticated();
var wiStore = tc.GetService<TestManagementService>();
var project = wiStore.GetTeamProject(tpp.SelectedProjects[0].Name);
SetAreaPathByTestSuiteID(project, 501);
}
private static void SetAreaPathByTestSuiteID(ITestManagementTeamProject project, int testSuiteID)
{
var testSuite = project.TestSuites.Find(testSuiteID).TestCases;
foreach (ITestSuiteEntry entry in testSuite)
{
ITestCase theCase = entry.TestCase;
theCase.Area = "NewAreaPath"; //Error thrown here
theCase.Save();
}
}
Run Code Online (Sandbox Code Playgroud) 我想在来自自托管构建服务器的 Azure Devops 发布管道中从 powershell 脚本执行 git push 。
它在构建管道中工作,但从发布管道中我最终遇到身份验证错误。“允许脚本访问 OAuth 令牌”已激活,并且构建机器具有贡献权限(正如我所说,它在构建管道中工作)。
这是我在 devops protal 中看到的错误:
git : remote: 001f# service=git-receive-pack
At C:\Builds\A1\_work\r1\a\Source\Scripts\CreateTagFromPipeline.ps1:11 char:1
+ git push
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (remote: 001f# service=git-receive-pack:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
PowerShell exited with code '1'.
Run Code Online (Sandbox Code Playgroud)
如果我通过远程桌面登录到机器并手动推送,我会得到一些更好的错误:
$ git push
remote: 001f# service=git-receive-pack
remote: 0000000000aaTF401027: You need the Git 'GenericContribute' permission to perform this action. Details: identity 'Build\58bb64d7-d065-4522-94e2-a153b9fdadd6', scope 'repository'.
remote: TF401027: You need the Git 'GenericContribute' permission to …Run Code Online (Sandbox Code Playgroud)