2
votes

I'm new to TeamCity so please be gentle

I've set up teamcity on the build server. .net builds work when initiated through Visual Studio Team Builds, but not when started through Teamcity (via clicking on the run button in administration, plus on check-in).

The builds are failing with loads of similar reference errors, such as.. User Controls\ucCalendar.cs

(19, 11): error CS0246: The type or namespace name 'AxMSACAL' could not be found (are you missing a using directive or an assembly reference?)
followed by our own objects which have not been created due to other errors.
DAL\OrderItemCollection.cs

(31, 16): error CS0246: The type or namespace name 'OrderItem' could not be found (are you missing a using directive or an assembly reference?)

I understand what these errors mean, but I obviously am missing something fundamental, as I do not understand why it is working when built on the build machine via TFS/Team Build but failing on teamcity when..

  • both are using the same physical build machine
  • both are using the same source : from TFS
  • both are using MSBuild to build the solution
  • source includes an external references directory for dll's etc

What is TeamCity doing differently to TFS/TB that is causing these errors?

Any pointers would be very helpful. Cheers

2
What build runner do you use to initiate a build on Teamcity?the_joric
@the_joric - build runner is MSBuildFetchez la vache
And you just run your solution? Then I would advise go to your' build agent folder and run msbuild from there. You'll see what files are missing and would be able to change your build settings accordingly.the_joric

2 Answers

3
votes

Things you can try:

  1. Make sure your TFS VCS Settings are correct, you need to attach your TFS VCS root and then add Checkout rules with this syntax:

    +:path/to/ProjectFolder=>.
    +:path/to/libary=>library/path
    

    This will check out the contents of your Project folder to the agent.work.dir/buildNumber and your library to agent.work.dir/buildNumber/library/path.

  2. Open Visual Studio and check the references to your libraries, then go to the buildmachine and open /buildNumber (you will find the path in TeamCity->Agents->(TeamCityAgent)->Agent Parameters. Look for your Libraries and see where TeamCity has checked them out to.

  3. It might also help to open the checked out solution on the buildmachine (agent.work.dir)/buildNumber, providing VS is installed. You should see where your references are off

0
votes

Usually, this is TeamCity not being able to find something that exists on the build server/developers system but doesn't exist when TeamCity recreates the build environment "cleanly". It's exactly what brought us to using it, to catch these types of "it builds on my system!" errors.

Does the AxMSACAL project get built in the right order by TeamCity? If it's a 3rd party component is it being pulled down by TeamCity?