I am having trouble with my build for TeamCity. When I build the project locally, it compiles correctly, however, when TeamCity runs, the build fails with error Build failure condition: Process exited with code 1
.
I have two separate projects with this same failure condition and I have no idea even how to begin diagnosing the problem. One project is a C# library created via Visual Studio 2010 (and I use the VS Solution to compile that project) and the other is done using Xamarin Studio.
The Xamarin Studio build step which is to compile the code uses the line (ignore the line breaks):
"C:\Program Files (x86)\Xamarin Studio\bin\mdtool.exe" build
"--project:MyProject"
"%teamcity.build.checkoutDir/MySolution.sln"
Both projects compile on the build agent (when compiled locally through either Visual Studio or the command line command). Is there a way for me to have the build agent (i.e. the service running) to run the build config locally and test from there or what?
You can instruct TeamCity to mark a build as failed if some of its metrics (for example, code coverage or artifacts size) have changed compared to another build. For instance, you can mark a build as failed if the code duplicates number is higher than in the previous build.
The error you're getting is only the return value from the MSBuild process. In order to debug the build process you need to run it for real - meaning in the same fashion as the build runner will, not doing a local debug build in your dev environment. Follow the steps here to increase the MSBuild logging to verbose and save it to a location where you can inspect it later.
If your application is reasonably complex or has lots of dependencies you'll probably have to spend a few hours writing a build script or editing the project files. If you write build script just change the build task in TC to execute the build script. That's generally the approach I've used with TC since editing the project files will affect your local debug builds.
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