Link to binaries from one project to another

Newbie question: I have 2 C # projects in TeamCity, name them A and B. A contains a link to B.dll. B builds great. However, A cannot be built because it cannot find B: Could not find assembly "B"

It seems very simple: how can I tell my project A on the builds server where to find the binaries from B \ bin \ Release?

+4
source share
2 answers

The problem you are facing is that Teamcity runs each assembly in its own temporary directory, and since this is a randomly generated name, you cannot set the link directly from one to the other.

Typically, you should write a script assembly that builds both A and B in the correct order and just runs Teamcity, which builds the script. (Since you are using C #, MSBuild is perfect for this).

An alternative would be to copy B.dll to a known location (eg c:\currentbuild ) at the end of its assembly and have A always refer to it here. You can customize build dependencies in Teamcity so that if B is rebuilt, A is also rebuilt.

0
source

You do this by creating 'Artifacts and artifact dependencies.

If project A depends on project B, then you create an Artifact in project B using the artifact path, for example:

 bin/Release/B.dll 

Then in project A, you establish the dependency of the artifact with B using the path, for example:

 B.dll 

And set the destination path, wherever Project A expects to find B.dll, for example.

 ./Libs 

You can do other interesting things, such as automatically archiving all your artifacts in zip using the syntax:

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

and access them through:

 B.zip!B.dll 

All these paths belong to the assembly directories, therefore they are simplified, and you do not need to worry about the folders of the TeamCity manual or use absolute paths.

+12
source

Source: https://habr.com/ru/post/1311842/


All Articles