Visual Studio Team Services在Azure中构建服务器

时间:2016-07-15 10:36:23

标签: azure msbuild azure-devops vstest

我正在尝试为Azure中的Visual Studio Team Services创建自定义构建服务器。我已经在虚拟机上安装了构建代理和Visual Studio Express,该虚拟机在visualstudio.com上作为构建代理运行并连接到我的项目,并且默认"池。

然而,当我尝试运行构建时,我收到以下错误:

No agent found in pool 1 which satisfies the specified demands:
msbuild
visualstudio
vstest
Agent.Version -gtVersion 1.98.1

MSBuild已经在visualstudio.com上的功能列表中,而不是其他两个,所以我挖掘了C:\Program Files (x86)并将这两个功能添加到列表中:

vstest: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow
visualstudio: C:\Program Files (x86)\Microsoft Visual Studio 14.0

然后构建至少会运行,但在"测试程序集"步。我认为错误消息中最重要的部分是Unable to determine the location of vstest.console.exe,无论如何它都在这里:

System.Management.Automation.CmdletInvocationException: Unable to determine the location of vstest.console.exe ---> System.IO.FileNotFoundException: Unable to determine the location of vstest.console.exe
at Microsoft.TeamFoundation.DistributedTask.Task.Internal.PowerShell.InvokeVSTestCmdlet.GetVsTestLocation()
at Microsoft.TeamFoundation.DistributedTask.Task.Internal.PowerShell.InvokeVSTestCmdlet.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at Microsoft.TeamFoundation.DistributedTask.Handlers.PowerShellHandler.Execute(ITaskContext context, CancellationToken cancellationToken, Int32 timeoutInMinutes)
at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.RunTask(ITaskContext context, TaskWrapper task, CancellationTokenSource tokenSource)

我看过vstest.console.exe位于我上面指定的vstest文件夹中,我还尝试将此文件夹添加到系统PATH,但这没有任何区别。

如何在Azure中设置有效的构建代理?

4 个答案:

答案 0 :(得分:1)

Visual Studio Express没有测试工具。安装Visual Studio社区(假设您符合基于许可条款的社区资格),或者您或您的组织获得许可的Visual Studio版本(专业/企业)。

答案 1 :(得分:1)

在测试程序集下的TFS构建日志中,我看到错误:

  

System.Management.Automation.CmdletInvocationException:无法确定vstest.console.exe的位置

我将VSTest设置为Visual Studio 2015,我使用的是VS / TFS2017,因此切换到最新解决了问题:

enter image description here

答案 2 :(得分:0)

您需要在构建服务器上安装Visual Studio。此时,构建代理将识别可用的功能,如msbuild, visualstudio, and vstest

答案 3 :(得分:0)

I found a solution,您只需要说服您的构建计算机确实安装了VS.从链接:

  

对我有用的是创建以下注册表项:   HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \微软\ VisualStudio的\ 14.0

     

并在该键内创建一个名为string的新值   ShellFolder和值C:\ Program Files(x86)\ Microsoft Visual Studio   14.0。

     

希望有所帮助

相关问题