Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/313.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
C# 创建pull请求并以编程方式向其添加审阅者、工作项_C#_Visual Studio_Azure - Fatal编程技术网

C# 创建pull请求并以编程方式向其添加审阅者、工作项

C# 创建pull请求并以编程方式向其添加审阅者、工作项,c#,visual-studio,azure,C#,Visual Studio,Azure,我使用以下语句创建了一个请求: pullRequest = gitClient.CreatePullRequestAsync(gitPullRequest, shrdRepo.Id, supportsIterations: true, cancellationToken: token).Result; 我正在尝试向其中添加审阅者和工作项。 对于审阅者添加,尝试使用以下语句标识审阅者。但我有个例外: IdentityHttpClient ide

我使用以下语句创建了一个请求:

pullRequest = gitClient.CreatePullRequestAsync(gitPullRequest, shrdRepo.Id, 
                         supportsIterations: true, cancellationToken: token).Result;
我正在尝试向其中添加审阅者和工作项。 对于审阅者添加,尝试使用以下语句标识审阅者。但我有个例外:

IdentityHttpClient identityHttpClient = new IdentityHttpClient(new Uri(c_collectionUri), creds);
IdentitiesCollection identitiesPerAlias = identityHttpClient.ReadIdentitiesAsync(IdentitySearchFilter.MailAddress, mail, cancellationToken:token).Result;
例外情况是:

Exception when looking for vsts identity for alias xyzxyz.com. System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.Services.WebApi.VssResourceNotFoundException: API resource location 28010c54-d0c0-4c89-a5b0-1c9e188b9fb7 is not registered on https://dev.azure.com/xyz.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<CreateRequestMessageAsync>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__28`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Identity.Client.IdentityHttpClient.<ReadIdentitiesAsyncInternal>d__42.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at AzureDevOpsSample.Program.<SearchForReviewerVstsIdentity>d__4.MoveNext() in D:\Projects\tools_release_notes\tools-ReleaseNotes_PR_Working\createPrForSharedRepo\Program.cs:line 349
---> (Inner Exception #0) Microsoft.VisualStudio.Services.WebApi.VssResourceNotFoundException: API resource location 28010c54-d0c0-4c89-a5b0-1c9e188b9fb7 is not registered on https://dev.azure.com/xyz.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<CreateRequestMessageAsync>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__28`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Identity.Client.IdentityHttpClient.<ReadIdentitiesAsyncInternal>d__42.MoveNext()<---
查找别名xyzxyz.com的vsts标识时出现异常。System.AggregateException:发生一个或多个错误。-->Microsoft.VisualStudio.Services.WebApi.VssResourceNotFoundException:API资源位置28010c54-d0c0-4c89-a5b0-1c9e188b9fb7未在上注册https://dev.azure.com/xyz. 位于Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d_u34.MoveNext()上 ---来自引发异常的上一个位置的堆栈结束跟踪--- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中 位于Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d_u28`1.MoveNext() ---来自引发异常的上一个位置的堆栈结束跟踪--- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中 在Microsoft.VisualStudio.Services.Identity.Client.IdentityHttpClient.d_u42.MoveNext()上 ---内部异常堆栈跟踪的结束--- 位于System.Threading.Tasks.Task.ThrowifeException(布尔值IncludeTaskCanceledException) 位于System.Threading.Tasks.Task`1.GetResultCore(布尔waitCompletionNotification) 在System.Threading.Tasks.Task`1.get_Result()中 在d:\Projects\tools\u release\u notes\tools-ReleaseNotes\u PR\u Working\createPrForSharedRepo\Program.cs中的AzureDevSample.Program.d\u 4.MoveNext()中:第349行 --->(内部异常#0)Microsoft.VisualStudio.Services.WebApi.VssResourceNotFoundException:API资源位置28010c54-d0c0-4c89-a5b0-1c9e188b9fb7未在上注册https://dev.azure.com/xyz. 位于Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d_u34.MoveNext()上 ---来自引发异常的上一个位置的堆栈结束跟踪--- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中 位于Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d_u28`1.MoveNext() ---来自引发异常的上一个位置的堆栈结束跟踪--- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中 在Microsoft.VisualStudio.Services.Identity.Client.IdentityHttpClient.d_u42.MoveNext()上