.net 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20008861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Team city unmet requirement: MSBuildTools12.0_x86_Path exists
提问by archangel76
I have a TeamCity install on x32 Server2008 windows machine. I've run the .net 4.5 web install. I've also copied over the files from my x64 machine based on this article so that I didn't need to install vs2012 (though, I did have the change the path to remove x86 on the 32bit machine):
我在 x32 Server2008 Windows 机器上安装了 TeamCity。我已经运行了 .net 4.5 网络安装。我还根据这篇文章从我的 x64 机器上复制了文件,这样我就不需要安装 vs2012(不过,我确实更改了在 32 位机器上删除 x86 的路径):
MSBuild in TeamCity of Visual Studio 2012 solution
Visual Studio 2012 解决方案 TeamCity 中的 MSBuild
I can't seem to get the local agent to run the build that I've setup for msbuild on a vs2012 or vs2010 project. I keep getting:
我似乎无法让本地代理运行我在 vs2012 或 vs2010 项目上为 msbuild 设置的构建。我不断得到:
Unmet requirements: MSBuildTools12.0_x86_Path exists
未满足的要求:MSBuildTools12.0_x86_Path 存在
I've restarted the server multiple times, and restarted the agent as well. I've tried messing with the path variables a little, but can't figure out what I'm missing. I've looked as well in the Configuration Parameters, and can see these:
我已经多次重新启动服务器,并重新启动代理。我试过稍微弄乱路径变量,但无法弄清楚我错过了什么。我也查看了配置参数,可以看到这些:
MSBuildTools2.0_x86_Path C:\Windows\Microsoft.NET\Framework\v2.0.50727
MSBuildTools2.0_x86_Path C:\Windows\Microsoft.NET\Framework\v2.0.50727
MSBuildTools3.5_x86_Path C:\Windows\Microsoft.NET\Framework\v3.5
MSBuildTools3.5_x86_Path C:\Windows\Microsoft.NET\Framework\v3.5
MSBuildTools4.0_x86_Path C:\Windows\Microsoft.NET\Framework\v4.0.30319
MSBuildTools4.0_x86_Path C:\Windows\Microsoft.NET\Framework\v4.0.30319
How do I get 12.0 in there?
我如何在那里获得 12.0?
回答by jmw
I needed to install MSBuild separately, then after restarting the agent the variable was there.
我需要单独安装 MSBuild,然后在重新启动代理后变量就在那里。
(From MSDN article)MSBuild is now installed as part of Visual Studio rather than as part of the .NET Framework. The current MSBuild version number is 12.0. If you want to install MSBuild separately, download the installation package from MSBuild Download.
(来自 MSDN 文章)MSBuild 现在作为 Visual Studio 的一部分安装,而不是作为 .NET Framework 的一部分安装。当前的 MSBuild 版本号是 12.0。如果要单独安装 MSBuild,请从 MSBuild 下载中下载安装包。
edit: the answer link was broken. Here is the link for Microsoft Build Tools 2015 (most recently until today): https://www.microsoft.com/en-us/download/details.aspx?id=48159
编辑:答案链接已损坏。这是 Microsoft Build Tools 2015 的链接(最近到今天):https: //www.microsoft.com/en-us/download/details.aspx?id=48159
回答by Harper Shelby
A bit of a late answer, but if your project is from VS 2012, and you're using the autodetected solution file build step, editing that step and choosing "Microsoft Visual Studio 2012" from the "Visual Studio" drop down fixes this issue as well (and, IMHO, more correctly).
答案有点晚,但如果您的项目来自 VS 2012,并且您使用的是自动检测解决方案文件构建步骤,请编辑该步骤并从“Visual Studio”下拉列表中选择“Microsoft Visual Studio 2012”可解决此问题以及(和,恕我直言,更正确)。
回答by Andreas Schuermann
I had the same problem and at the end it turned out that my defined build step to run MSBuild was configured wrong.
我遇到了同样的问题,最后发现我定义的运行 MSBuild 的构建步骤配置错误。
In my MSBuild build step the setting "MSBuild ToolsVersion" was set to 12.0 (default), which lead to the error "Unmet requirements: MSBuildTools12.0_x86_Path exists" on my system. Because I don't need the new MSBuild 12.0 to run my build, I changed this setting to 4.0 in my build step. This MSBuild version is correctly installed on my system. This solved the issue for me.
在我的 MSBuild 构建步骤中,设置“MSBuild ToolsVersion”设置为 12.0(默认),这导致我的系统上出现错误“未满足的要求:MSBuildTools12.0_x86_Path 存在”。因为我不需要新的 MSBuild 12.0 来运行我的构建,所以我在构建步骤中将此设置更改为 4.0。此 MSBuild 版本已正确安装在我的系统上。这为我解决了这个问题。
回答by Robert Hardy
I'm also a bit late to the party but I thought I'd share the following in case it helps any poor soul out there.
我参加聚会也有点晚了,但我想我会分享以下内容,以防它对那里的任何可怜的灵魂有所帮助。
- I got the above mentioned error on a fresh install of TeamCity 8.1.4on a new Windows Server 2012 R2box
- Followed the instructions in this thread and the error still appeared despite numerous restarts and reinstalls.
- I noticed that the agent info such as OS and CPU was not appearing on the agent details page. This indicated that the problem was not with the .NET and MSBUILD prerequisites but were instead related to the agent service not being able to read info about the machine.
- The agent was running under a user's account (with all the necessary permissions as per the TeamCity documentation). But I thought I'd see what would happen if I went in to Admin Tools > Services and changed the Log On to Local system account.
- Restarted the agent service.
- Great success.
- 我得到了上面的新鲜提到的错误的安装TeamCity的8.1.4上了一个新的Windows Server 2012 R2箱
- 按照此线程中的说明进行操作,尽管多次重新启动和重新安装,错误仍然出现。
- 我注意到代理信息(例如操作系统和 CPU)没有出现在代理详细信息页面上。这表明问题不在于 .NET 和 MSBUILD 先决条件,而是与代理服务无法读取有关机器的信息有关。
- 代理在用户帐户下运行(根据TeamCity 文档具有所有必要的权限)。但我想如果我进入“管理工具”>“服务”并更改“登录到本地”系统帐户,我会看到会发生什么。
- 重新启动代理服务。
- 巨大的成功。
回答by Steve Bering
MSBuild is now part of Visual Studio. If you need to install the build tools on your agent but don't want to install VS, you will need to install the new Microsoft Build Tools which is available at http://www.microsoft.com/en-us/download/details.aspx?id=40760.
MSBuild 现在是 Visual Studio 的一部分。如果您需要在代理上安装构建工具但不想安装 VS,则需要安装新的 Microsoft 构建工具,该工具可从http://www.microsoft.com/en-us/download/ 获得details.aspx?id=40760。
回答by miotis
In my case - only separate installation of MSBuild for VS2013 helped. (here is link - https://www.microsoft.com/en-us/download/confirmation.aspx?id=40760) It created this folder C:\Program Files (x86)\MSBuild\12.0Installation of MSBuild tools for VS2015 created C:\Program Files (x86)\MSBuild\14.0this folder, and TC didn't want to use it.
就我而言 - 只有为 VS2013 单独安装 MSBuild 才有帮助。(这里是链接 - https://www.microsoft.com/en-us/download/confirmation.aspx?id=40760)它创建了这个文件夹C:\Program Files (x86)\MSBuild\12.0VS2015 的 MSBuild 工具安装创建了C:\Program Files (x86)\MSBuild\14.0这个文件夹,TC 不想用它。
回答by Hildesheim
I had this problem on my secondary build agent.
我在我的辅助构建代理上遇到了这个问题。
I had copied the MSBuild folder from the primary build agent pc to the secondary build agent pc (like I did with some Visual Studio files as described here: MSBuild in TeamCity of Visual Studio 2012 solution), rather than installing MSBuild.
我已将 MSBuild 文件夹从主构建代理 pc 复制到辅助构建代理 pc(就像我对一些 Visual Studio 文件所做的那样:Visual Studio 2012 解决方案 TeamCity 中的 MSBuild),而不是安装 MSBuild。
It seems, however, that the TeamCity agent services checks the registry for MSBuild entries when it starts up (it does not seem to do this with the Visual Studio files i mention above). Since I had simply copied the files from the other pc, no MSBuild entry for v. 12.0 existed, so TeamCity did not discover the MSBuild files even though they were present in the Program Files (x86)\MSBuild folder.
然而,TeamCity 代理服务似乎在启动时检查注册表中的 MSBuild 条目(它似乎没有对我上面提到的 Visual Studio 文件执行此操作)。由于我只是从另一台电脑复制了文件,因此不存在 v. 12.0 的 MSBuild 条目,因此 TeamCity 没有发现 MSBuild 文件,即使它们存在于 Program Files (x86)\MSBuild 文件夹中。
When I installed the Microsoft Build Tools from the link above http://www.microsoft.com/en-us/download/details.aspx?id=40760TeamCity found the v. 12.0 entry in the registry and the agent was able to build the same projects as the primary agent.
当我从上面的链接安装 Microsoft Build Tools 时http://www.microsoft.com/en-us/download/details.aspx?id=40760TeamCity 在注册表中找到了 v. 12.0 条目,并且代理能够构建与主代理相同的项目。
Remember to restart the TeamCity agent service after installing MS Build Tools.
请记住在安装 MS Build Tools 后重新启动 TeamCity 代理服务。
回答by DerSkythe
In my case I have TeamCity Professional 2018.1 on Windows 2016 Server. I downloaded Build Tools for Visual Studio 2017from here: https://visualstudio.microsoft.com/downloads/and selected all options for build tools. After install I added MSBuild to the global PATH environment variable. C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin in my case.
就我而言,我在 Windows 2016 Server 上安装了 TeamCity Professional 2018.1。我从这里下载了 Visual Studio 2017 的构建工具:https: //visualstudio.microsoft.com/downloads/并选择了构建工具的所有选项。安装后,我将 MSBuild 添加到全局 PATH 环境变量中。C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin 在我的例子中。
回答by Aleksei Mialkin
回答by Shantu
In my case, it was a new machine without visual studio installed and i just restored Teamcity from another machine. So i have installed visual studio 2013 and solved teamcity agent problem.
就我而言,这是一台没有安装 Visual Studio 的新机器,我刚刚从另一台机器恢复了 Teamcity。所以我安装了visual studio 2013并解决了teamcity代理问题。


