Team city unmet requirement: MSBuildTools12.0_x86_

2019-01-21 08:21发布

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):

MSBuild in TeamCity of Visual Studio 2012 solution

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:

Unmet requirements: MSBuildTools12.0_x86_Path exists

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

MSBuildTools3.5_x86_Path C:\Windows\Microsoft.NET\Framework\v3.5

MSBuildTools4.0_x86_Path C:\Windows\Microsoft.NET\Framework\v4.0.30319

How do I get 12.0 in there?

10条回答
【Aperson】
2楼-- · 2019-01-21 08:53

I had the same problem and at the end it turned out that my defined build step to run MSBuild was configured wrong.

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.

查看更多
放我归山
3楼-- · 2019-01-21 08:53

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.

查看更多
手持菜刀,她持情操
4楼-- · 2019-01-21 08:55

I needed to install MSBuild separately, then after restarting the agent the variable was there.

(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.

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

查看更多
疯言疯语
5楼-- · 2019-01-21 09:01

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.4 on a new Windows Server 2012 R2 box
  • 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.
查看更多
我欲成王,谁敢阻挡
6楼-- · 2019-01-21 09:02

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.

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.

When I installed the Microsoft Build Tools from the link above http://www.microsoft.com/en-us/download/details.aspx?id=40760 TeamCity found the v. 12.0 entry in the registry and the agent was able to build the same projects as the primary agent.

Remember to restart the TeamCity agent service after installing MS Build Tools.

查看更多
你好瞎i
7楼-- · 2019-01-21 09:03

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.

查看更多
登录 后发表回答