TFS Build Agent处于脱机状态

fan*_*dro 4 tfs offline tfsbuild build-agent azure-devops

我使用TFS 2015,我看到我的构建代理处于离线状态:

我启动VsoWorker.exe来查看日志并理解错误,这是我得到的但是我从互联网上找不到任何东西:请问有什么想法吗?

16:07:57.649004 Sending trace output to log files: C:\Users\Administrator\Downloads\agent\_diag
16:07:57.649004 vsoWorker.exe was run with the following command line:
"C:\Users\Administrator\Downloads\agent\Agent\Worker\VsoWorker.exe" 
16:07:57.649004 VsoWorker.Main(): Create AgentLogger
16:07:57.649980 VsoWorker.Main(): Parse command line
16:07:57.655848 ---------------------------------------------------------------------------
16:07:57.657635 System.Exception: The /name command line option is required and must have a value.

16:07:57.657635    at VsoWorker.CommandLine.ValidateCommandLine()

16:07:57.657635    at VsoWorker.CommandLine..ctor(String[] args)

16:07:57.657635    at VsoWorker.Program.Main(String[] args)
16:07:57.657635    at VsoWorker.CommandLine.ValidateCommandLine()

16:07:57.657635    at VsoWorker.CommandLine..ctor(String[] args)

16:07:57.657635    at VsoWorker.Program.Main(String[] args)
16:07:57.657635 ---------------------------------------------------------------------------
16:07:57.658878 BaseLogger.Dispose() 
Run Code Online (Sandbox Code Playgroud)

Jer*_*son 6

TFS 2017:

安装Build Agent时,系统会指示您创建C:\ Agents文件夹:

在此输入图像描述

如果尚未首先配置Build Agent,请打开Powershell并运行以下命令:

PS C:\agent> .\config.cmd
Run Code Online (Sandbox Code Playgroud)

最后执行此命令以运行Build Agent:

PS C:\agent> .\run.cmd
Run Code Online (Sandbox Code Playgroud)

这应该使Build Agent在线.

注意:我第一次尝试这个并且它有效.第二次它没有,我改为运行C:\ agent\bin\Agent.Listener.exe.我尝试了第三次运行run.cmd,这次我等了一两分钟它运行了:

在此输入图像描述

注意:最好让代理作为服务运行,这样您只需要一次config.cmd,就不需要运行run.cmd.