无法在TFS上运行构建,授权错误

时间:2014-09-18 08:39:58

标签: c# .net visual-studio tfs continuous-integration

我有以下情况 - 我已经构建了服务,在

上提供项目集合
http://localhost:7575/tfs/defaultcollection

在同一个虚拟机上运行构建服务和TFS。

但是当我从VS构建运行构建失败时出现异常:

TF215097: An error occurred while initializing a build for build definition \HelloWorld\test___3: 
Exception Message: One or more errors occurred. (type AggregateException)
Exception Stack Trace:    at System.Threading.Tasks.Task`1.GetResultCore(Boolean     waitCompletionNotification)

at Microsoft.TeamFoundation.Build.Client.FileContainerHelper.GetFile(TfsTeamProjectCollection projectCollection, String itemPath, Stream outputStream)
at     Microsoft.TeamFoundation.Build.Client.FileContainerHelper.GetFileAsString(TfsTeamProjectCollection   projectCollection, String itemPath)
at Microsoft.TeamFoundation.Build.Client.ProcessTemplate.Download(String sourceGetVersion)
at            Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(Workflow    ManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext)
at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error,  Boolean& syncLockTaken)

Inner Exception Details:

Exception Message: VS30063: You are not authorized to access http://HelloWorld.com:7575. (type    VssUnauthorizedException)
Exception Stack Trace:    at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.<SendAsync>d__0.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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpRetryMessageHandler.<SendAsync>d__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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.HttpClientExtensions.  <DownloadFileFromTfsAsync>d__2.MoveNext()    

如果我错了,请纠正我 - 当构建开始时,他请求TFS构建服务,服务调用TFS DefaultCollection地址,使用自由代理调用活动控制器,然后构建开始。

在我的情况下,构建服务调用错误的DefaultCollection地址 - http://HelloWorld.com:7575而不是http://localhost:7575/tfs,并且因为这些原因导致身份验证失败。

那么,我是否对我的建议有所了解,我能做些什么来解决它?

我在TFSBuildServiceHost.exe.config文件中添加了以下代码

<system.diagnostics> <switches> <add name="BuildServiceTraceLevel" value="4"/> </switches> <trace autoflush="true" indentsize="4"> <listeners> <add name="myListener" type="Microsoft.TeamFoundation.TeamFoundationTextWriterTraceListener,Microsoft.TeamFoundation.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" initializeData="c:\logs\TFSBuildServiceHost.exe.log" /> <remove name="Default" /> </listeners> </trace> </system.diagnostics>

只记录了以下内容:

[, PID 13344, TID 15088, 2014/09/18 10:09:07.917] Web method running:     [http://localhost:7575/tfs/defaultcollection/_apis/connectionData?    connectOptions=IncludeServices&lastChangeId=-1] (GET)connectionData[connectionData]
[, PID 13344, TID 10064, 2014/09/18 10:09:08.100] Web method response: [http://localhost:7575/tfs/defaultcollection/_apis/connectionData?connectOptions=IncludeServices&lastChangeId=-1] (GET)connectionData[connectionData] 181 ms

1 个答案:

答案 0 :(得分:0)

确保以管理员身份运行VS.