.netversion-controltfstfsbuild

Output of One Build Included In Another


What is the proper way to include an output of one build as a binary in another build?

Lets say I have a solution called CompanyName.Domain (my Domain Layer). I have it set up as a build and it builds nightly.

Now I want to add a solution called SomeProject.Web. And I want to include the binary out of CompanyName.Domin into a Binaries folder at a peer level with my solution. Then the project SomeProjects.Web reference to Binaries\CompanyName.Domain.dll will work.

What is best practices for doing this? I know someone who said they were trying to do this with branching. I'm a total "source control" newb. But something about this sounds wrong.


Solution

  • Just like Daryl, we use a "Binaries" folder that we reference binaries from. Our "libraries" builds just xcopy the results into the binaries location, so if we wish to update the libraries, we just check out the binaries, build, and check them in again.

    This allows us to share all our internal libraries (as well as any 3rd party libraries we use) from a single standardised location, and all our libraries can be prebuilt, saving our devs having to build them if they are not actually changing anything in the libs .

    Take care to only reference Release builds of your libraries (the only exception we have to this is that we have a library of debugging helpers which are conditionally compiled into debug builds only, and we must reference the debug version of it otherwise all our debug is compiled out of the program even in debug builds!)

    One last note: Avoid branching unless there is no reasonable alternative.