私有构建代理无法识别Visual Studio 2015 Express [英] Visual Studio 2015 Express not recognised by private build agent

查看:120
本文介绍了私有构建代理无法识别Visual Studio 2015 Express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在一台机器上安装Visual Studio 2017 Community Edition并将其注册为生成代理,则针对代理注册的功能"选项卡将显示以下环境变量:

If I install Visual Studio 2017 Community edition on a machine and registered it as a build agent, then the 'capabilities' tab against the agent registration shows the following environment variables:

VisualStudio            C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
VisualStudio_15.0       C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
VisualStudio_IDE        C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\
VisualStudio_IDE_15.0   C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\

但是,如果我安装Visual Studio 2015 Express并将其注册为生成代理,则不会获得等效变量.为什么会这样?

However, if I install Visual Studio 2015 Express and register it as a build agent, I do not get the equivalent variables. Why is this?

@ starain-MSFT可以解决此问题; VS2015 Express不会为代理配置脚本安装所有必需的注册表项,以进行安装.手动注册上面的环境变量会使代理程序池无法识别功能msbuild, visualstudio,因此现在我可以愉快地触发该代理程序上的构建.

@starain-MSFT eluded to the problem; VS2015 Express does not install all the required registry keys for the agent config script to pick up the installation. Registering the environment variables above manually fools the agent pool into recognising the capabilities msbuild, visualstudio, so now I can trigger builds on that agent happily.

但是,它并没有欺骗Visual Studio Build任务.我在执行时收到以下日志警告;

However, it doesn't fool the Visual Studio Build task. I get the following log warning on execution;

##[warning]Visual Studio was not found. Try installing a supported version of Visual Studio. See the task definition for a list of supported versions.

然后将其还原回MSBuild以执行工作流程.幸运的是,由于我正在构建.sln,因此它成功完成了.我只是想警告其他人,他们可能会遇到类似的问题.

It then reverts back to MSBuild to execute the workflow. Fortunately in my case it completes successfully because I am building a .sln. I just want to warn others out there they may experience similar problems.

推荐答案

[agent folder]\bin\powershell文件夹中有一些PowerShell文件用于添加功能,您可以检查它们的源代码.

There are some PowerShell files in [agent folder]\bin\powershell folder that used to add capabilities, you can check the source code of them.

基于Add-VisualStudioCapabilities.ps1中的代码,它会检查HKEY_LOCAL_MACHINE\SOFTWARE\[WOW6432Node]\Microsoft\VisualStudio\[14.0]\ShellFolder and InstallDir.因此,您可以在注册表中检查键和值.

Based on the code in Add-VisualStudioCapabilities.ps1, it checks HKEY_LOCAL_MACHINE\SOFTWARE\[WOW6432Node]\Microsoft\VisualStudio\[14.0]\ShellFolder and InstallDir. So you can check the keys and values in registry.

这篇关于私有构建代理无法识别Visual Studio 2015 Express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆