Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referencing binaries from one project in another

Tags:

teamcity

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?

like image 969
Aidan Avatar asked Dec 09 '22 15:12

Aidan


1 Answers

You do this by creating 'Artifacts' and artifact dependencies.

If project A is dependent on project B, then you create an Artifact on project B using an artifact path like so:

bin/Release/B.dll

Then on project A you setup a artifact dependency on B with path like:

B.dll

And set the destination path to be where ever project A is expecting to find B.dll e.g.

./Libs

You can do other cool stuff like automatically archiving all your artifacts into a zip by using the syntax:

bin/Release/*.dll => B.zip

and access them via:

B.zip!B.dll

All these paths are relative to build directories so makes it easy and you dont need to worry about the TeamCity guid folders or use absolute paths.

like image 124
Jack Ukleja Avatar answered Dec 31 '22 12:12

Jack Ukleja