views:

49

answers:

2

We are finally getting a source control system in place at work and I've been in charge of setting it up. I've read that it's usually good practice to not include binaries in source control so I haven't. However, we have two all-purpose utility projects (each in their own solution) that generate utility .dll's which are included in almost all of our other projects (all each in their own separate solutions). We add references to the utility dll from our projects.

I would like to have our solutions set up in such a way that if the reference dll isn't built, the solution will build the dll for itself, much in the same way a make file checks for its dependencies and builds them when they're out of date or missing.

I'm new to build processes with VS so try to keep the answers simple. Any links to general build process overview tutorials would be great too. Googleing for VS references returns a bunch of how-to add references links which is not exactly what I want.

Answer: (3 step process) Add a project reference, not a binary reference by right clicking on the solution, and adding an existing project. Then under the project tab, select project dependencies and modify the project so that one project depends on another. Finally, delete any old reference to the binary and re-add the reference using the project tab in the Add references dialog box.

+4  A: 

Where I work we typically have project references rather than binary references (as we used to a while ago). When you include a project reference, the dll will build along with the rest of your app.

The only time we go back to binary references is when we are in between Visual Studio releases (e.g. 1 project is in 2010 and everything else is in 2008. The 2010 project will have to use a binary reference for a couple of months until everyone else catches up... Project incompatibility seems to be a Visual Studio limitation that shouldn't exist).

EDIT

To add a project reference right click the solution and click Add and finally "Existing Project." Make sure that the utility projects are also under source control, and make sure that the workspaces are set up correctly or other people will not be able to open up the projects correctly!

Giovanni Galbo
Project references sounds like what I need, how do I add one?
Martin Neal
Right click the solution in Visual Studio and click Add Existing Project.
Giovanni Galbo
Well and then remove the old reference from the project and then re-add the reference, from the project tab.
Logan Capaldo
@Logan Thanks, I came back here just about to say it still doesn't work, but this was the last piece of the puzzle.
Martin Neal
+1  A: 

Some detail from MSDN:

MSDN: How to Prepare and Manage Builds

Span
Thanks @Span. That helped me get the dependencies/build order portion of it fixed.
Martin Neal