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
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).
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.
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.
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.
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.0
Installation of MSBuild tools for VS2015 created C:\Program Files (x86)\MSBuild\14.0
this folder, and TC didn't want to use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With