TFS版本定义中的部署测试代理任务失败,但出现以下异常:
未处理的例外情况: System.Management.Automation.PSInvalidOperationException:The 无法从外部调用WriteObject和WriteError方法 BeginProcessing,ProcessRecord和EndProcessing的重写 方法,它们只能在同一个线程中调用。 验证cmdlet是否正确进行这些调用,或联系 Microsoft客户支持服务。 2017-06-16T08:49:49.9634068Z
在 System.Management.Automation.MshCommandRuntime.ThrowIfWriteNotPermitted(布尔 needsToWriteToPipeline)2017-06-16T08:49:49.9634068Z at System.Management.Automation.MshCommandRuntime.WriteHelper_ShouldWrite(ActionPreference preference,ContinueStatus lastContinueStatus) 2017-06-16T08:49:49.9634068Z at System.Management.Automation.MshCommandRuntime.WriteWarning(WarningRecord 记录,布尔值overrideInquire)2017-06-16T08:49:49.9634068Z at System.Management.Automation.Cmdlet.WriteWarning(String text) 2017-06-16T08:49:49.9634068Z at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.Logger.WriteWarning(字符串 消息)2017-06-16T08:49:49.9634068Z at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.TestAgentDownloader.wc_DownloadFileCompleted(对象 发件人,AsyncCompletedEventArgs e)2017-06-16T08:49:49.9634068Z at System.Net.WebClient.OnDownloadFileCompleted(AsyncCompletedEventArgs e)2017-06-16T08:49:49.9634068Z at System.Threading.ExecutionContext.RunInternal(执行上下文 executionContext,ContextCallback回调,对象状态,布尔值 preserveSyncCtx)2017-06-16T08:49:49.9634068Z at System.Threading.ExecutionContext.Run(执行上下文 executionContext,ContextCallback回调,对象状态,布尔值 preserveSyncCtx)2017-06-16T08:49:49.9634068Z at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() 2017-06-16T08:49:49.9634068Z at System.Threading.ThreadPoolWorkQueue.Dispatch() 2017-06-16T08:49:55.4477257Z ## [错误] PowerShell脚本完成了 255错误。
如果未选中“更新测试代理”复选框,则任务将成功执行。 这里提到的解决方案https://github.com/Microsoft/vsts-tasks/issues/2964和https://social.msdn.microsoft.com/Forums/sqlserver/en-US/dae4c62d-cd23-40ad-83cf-2555d37c0bb9/test-agent-deployment-failing?forum=tfsbuild似乎无效
答案 0 :(得分:0)
高级 - 更新测试代理
如果已设置,测试代理已安装在测试中 机器,该任务将检查是否有新版本的测试代理 可用。
此外,如果您使用的是TFS2017 update2Rc并希望部署最新的测试代理,建议您使用版本2. 而不是1。对于Visual Studio测试代理部署任务,然后重试。
答案 1 :(得分:0)