tags:

views:

31

answers:

1

Newbie question : I have 2 C# projects in TeamCity, call them A and B. A contains a reference to B.dll. B builds fine. However, A fails to build because it cannot find B : Could not locate the assembly "B"

It seems really simple : how do I tell my project A on the buildserver where to find the binaries from B\bin\Release?

A: 

The problem you're encountering is that Teamcity runs each build in it's own temporary directory and since this is a randomly generated name you can't set a reference directly from one to the other.

Typically you would write a build script that builds both A and B in the right order and just have Teamcity run that build script. (Since you're using C#, MSBuild is ideal for this).

The alternative would be to have B.dll copied to a known location (e.g. c:\currentbuild) at the end of its build and have A always reference it from here. You can set up build dependencies in Teamcity so that if B is rebuilt, A is also rebuilt.

Paolo
Thanks for that answer, I can see the temp directories on the server, and I can create a Build Chain by adding a snapshot dependency. If I could just tell the snapshot to copy the binaries from B into the directory A is expecting, all would be well. Is there no way of doing that? Surely there must be?
Aidan
No, I don't think there is. That is why you should write a build script for TeamCity to execute.
Paolo