Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do I need to install for C++ project / VS 2013 on TeamCity server or Team Foundation Build Service?

I am attempting to build a C++ project in a Visual Studio 2013 solution on TC 8.0.6 (build 27767).

I have installed the latest MSBuild "Microsoft Build Tools 2013" stuff (which is normally installed as part of VS 2013 install) directly on the server.

But I get the following error:

[17:05:23]VCTargetsPath is c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\
[17:05:23]PlatformToolset is v120
[17:05:23]VCMessage
[17:05:23]c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32
Microsoft.Cpp.Win32.Targets(512, 5): error MSB8008: Specified platform toolset (v120) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
[17:05:23]Project MyCppProject\smCpp.vcxproj failed

As far as I can see I have everything I need and I have tried various hacks to set the PlatformToolset to v110 etc., but that doesn't work either.

At this stage I would like to verify exactly what I need to install on the build server. Can someone clarify if I need anything extra please?

Many thanks

Brian

like image 776
Redeemed1 Avatar asked Feb 04 '14 17:02

Redeemed1


People also ask

How do I run TeamCity?

Install and run on WindowsRun the downloaded .exe file and follow the instructions of the TeamCity Setup wizard. The TeamCity web server and one build agent will be installed on the same machine. During the installation, you can: set the TeamCity Home Directory where TeamCity will be installed.

How do I use TeamCity with Visual Studio?

Installation and StartIn your TeamCity web interface, choose My Settings and Tools under your username in the top right corner. Then, in the TeamCity Tools section on the right, click the Visual Studio Add-in download link. Download any of compatible JetBrains . NET products, e.g. ReSharper or dotCover.

How do you create a TeamCity project?

To add your first project, click Administration in the upper right corner of the TeamCity UI and then click Create project. There are several ways to create a project in TeamCity: automatically from a repository URL, from a connection to a specific VCS, or manually.


1 Answers

Ultimately you need to set the correct path to MSBuild. With VS 2013, build tooling became part of VS rather than .NET, making it version 12.0 instead of 4.0. The default path in this instance is:

"C:\Program Files (x86)\MSBuild\12.0\bin"

If the team foundation build is broken then it's likely because the TF server is not on version 2013. To fix the problem you need to make yourself a copy of the build template the build definition uses (assuming your version is >= 2010 and < 2013) and point to the correct tooling folder. The build templates are located in the following source path:

$/YourTeamProjectName/BuildProcessTemplates

If you can edit the template in Visual Studio you open the Workflow Foundation design surface. In there find the Run MSBuild for Project tasks (note in the default template there is more than one, but I've shown a pic of what to look for) and change the tool path property to the above path.

Team Build template

Once you created the template you need to change your build definition to use the new template.

For TeamCity you need to set the MSBuild ToolsVersion to version 12.0 in your build step. I'm not sure what version of TC started support for version 12.

like image 53
Christian Maslen Avatar answered Oct 20 '22 21:10

Christian Maslen