index > Team Foundation Server - Version Control > How to handle large numbers of projects and binary references

How to handle large numbers of projects and binary references


Currently we are in the midsts of moving from VS 2003 and VSS to VS 2005 and Team Foundation Server. Although we are a small development team of 4 developers, we manage and code over 200 projects which we currently have broken down into approximately 30 solutions.

Right now our VSS has the following structure:
$/
$/Company
$/Company/Folder
$Company/Folder/Solution1
$Company/Folder/Solution1/bin
$Company/Folder/Solution1/scripts
$Company/Folder/Solution1/Project1
$Company/Folder/Solution1/Project2
...
$Company/Folder/Solution1/ProjectN
$Company/Folder/Solution1/refs

$Company/Folder/Solution2
$Company/Folder/Solution2/bin
$Company/Folder/Solution2/scripts
$Company/Folder/Solution2/Project1
$Company/Folder/Solution2/Project2

etc...

The output of all projects in a solution get checked into the bin folder for the solution. For example, Project1 has output Solution1.Project1.dll. When we release Project1, we put the newest version of Solution1.Project1.dll into $Company/Folder/Solution1/bin.

Each project that needs references to assemblies which were built outside of their solution, adds a shared link from the assembly they need to their ref directory. Example: Project2 in Solution2 needs to reference Project1.dll from Solution1. We share $Company/Folder/Solution1/bin/Solution1.Project1.dll into the Solution2/refs. Then we add a binary reference to Project2 in Solution2. "Get Latest" on Solution2 will now make sure that we are referencing the most recent releases of all referenced assemblies.

As we move to Team Server and the TS source control, I realize that this won't work. In addition, I've always felt like our system of references was a bit of a kludge, and requires all sorts of scripting to make sure that when we release, we push the binaries into VSS.

How do other people deal with binary references? How about 3rd party assemblies?

In addition, we'd be interested in talking to someone who has experience in this possibly leading to a consulting gig to help us with our migration. Anyone in northern NJ, or the NY metro area who has experience setting up and/or migrating systems with many interdependant projects and solutions?

bpeikes
bpeikes,

I have set up several different companies with a system that handles all of the binary references at build time. The most recent was built around Visual Studio 2005 and MSBuild. The idea is that at project build time the task requests from, what I have been calling the Binary Library, a reference that is listed in the project. The reference is then copied to the output directory and used to compile against. The interesting part is that when the task requests the assembly, the Binary Library determines which, of all the published references, to return. An example would be: you want the assembly foo.dll but are only interested in the lastest version that was published (1.2.3.56), but somebody else in the oraganization is trying to fix an issue that was found in the 1.1.5 version of your product. They request the same foo.dll, with conditions, and the Binary Library returns the latest 1.1.5 version (1.1.5.456). The nice thing is that you can get as granular as you want.

Another interesting aspect is that not only is the referenced assembly returned, but all of the assemblies that are referenced by it, and so on until you have the entire dependency tree of the referenced assembly.

Unfortunately I am not anywhere near NJ or NY, but after working with these companies I just thought I would post this and see what you thought. I have been flirting with taking this out of Full-Time-Employment and your post offered me the chance to see if it was even remotly interesting (to anybody but myself).

If you would like to talk more about it please email at cscambpell@msn.com.

Thanks,
Craig
CraigCampbell
Seems like a very complicated way of handing references at build time.

It doesn't help in making sure that developers are compiling and testing against specific version of assemblies. It also does't explain how to deal with references in the project itself, only how to decide on which assemblies the build system should use.

This also means that there is no way to make sure that when you run your tests that you are using the same assemblies you'd be using in production.
bpeikes

Actually it isn't that complicated (once the initial configuration is completed ;-). Several custom tasks help the project only retrieve what references are listed in the project as "Binary Library References" (which is as simple as removing the HintPath element). These tasks also make sure that that what the developers are getting is what has been deployed into the integration test environment (but allows them the flexibility to use whatever version they are interested in, including those assemblies that have been delivered to production). The idea is that you can have several developers working on different parts of the application, and yet still be at the tip of any dependent development (without having to worry about updating a reference path or setting a link).

Once I have configured a project to use the Binary Library, the developer no longer has to worry about whether they are up-to-date on any references. They also don't have to worry about their build compiling a bunch of dependent projects that they haven't touched and may not have been touched in months. Their build times decrease, and the amount of information that they have to worry about shrinks, allowing them to focus on the task at hand. And if, by some fluke, bad code gets checked into the system, breaking a component they don't own, but rely on, they won't see it and will not be affected by it. However, on the flip side, if the component that they rely on changes one of its API method signatures, it will still break their call and they can then communicate with the other team and make the necessary changes to their own component.

CraigCampbell

We have a similar situation at my company. This question ahs come up before in the forums. Here is a blog post I wrote about a similar question (saves me from typing it again ). http://sstjean.blogspot.com/2006/09/team-build-how-do-you-deal-with.html

- Steve




http://sstjean.blogspot.com
Steve St.Jean
Well at least I don't feel like I'm completely off. I pushed for the bin/refs project system because it allows us to see the dependencies very easily. For example, project A produces a library libA.dll, and puts it into it's bin directory in sourcesafe. Projects B and C share libA.dll into their own refs directories.

Now let's say that the developer in charge of project A wants to make some changes. They can check all of the "links" to their assembly in their bin directory, and then make sure to talk to project leaders for Projects B and C and discuss the changes that they want to make.

How do you make sure that developers are using the most current version of assemblies developed in house?
bpeikes

To ensure that the newest reference binaries are used, we rely on our Continuous Integration (CI) system. Every time the CI build runs (every 10 minute interval that has at least one check-in), it goes out to the "corporate reference library" to get it's dependencies from the previous night's enterprise build. When the enterprise build runs each night, it stages out all of the binaries created to a central DFS share for the CI builds to grab. If dev team A makes a change to A.dll, that change gets picked up in the nightly enterprise build. The next day when team B's CI build runs for the first time, it will grab the new A.dll from the corporate reference library and build against it. If the changes to A.dll are incompatible with team B's code, the CI build fails and team B looks into the issue. If team B needs to be aware of every change team A makes as soon as possible, we have team B's CI build pull from team A's CI build reference library instead of the corporate reference library.

- Steve




http://sstjean.blogspot.com
Steve St.Jean
This sounds great, but how are people making references in their projects? Binary references or project references? Do you have one big solution with all of the projects?

Also, how do you keep track of which projects reference which assemblies? For instance, lets say that you want to make a change to A.dll, but you want to be able to see which references rely on that one before you make the change so that you can coordinate updates to applications which will need it?


Also, how do you deal with versioning? For instance, lets say current version of A.dll is 1.0, and you want to put out A.dll 2.0. Ideally all projects will automatically now reference 2.0, but sometimes you need the ability to override this on a project by project basis because you don't have time to update a particular application to use the new library.
bpeikes
reply 8

You can use google to search for other answers

 

More Articles

Team Projects Check-in Policy for managed and unmanaged projects
MSSCCI Provider and SQL Management Studio
Merge / commit not committing all pending changes
Version vs Changeset
Connect to a TFS as a different user
Extend version control at time of check in
Import non-VSS solution and projects?
Error: TF60059 Incremental Migration TFS Beta 3 Refresh
How to "perminately" delete a project from source contr...
Merge by WI
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Problem checking solution into TFS - Uns…
VC programming help needed
Moving Multiple Files/Folders
Organizing Project References Question (…
many applications sharing framework proj…
Add Version Control Folder to My Favorites
TreeDiff (IDE) bug/feature request
Sharing project code
how to delete the file or folder in v…
Missing references in web project
Now that we've made a total mess of thin…
managing source control folders through …
Max 260 characters in path + projectfold…
ThreeWayMerge.Run() crashes when IsBasel…
Version control API - basic recipes

Hot Articles

Open TFS dialogs
Is it possible to use the api to add a l…
How to handle TFVC events?
Logging files modifications
Team Foundation Server SCC Api
problem in migrating the code
Restrict access to all top level folders…
Bug in MSSCCI Provider or in VS2003 ?
How to "perminately" delete a …
Add arbitrary files and folders to sourc…
How to rollback bad check-in?
Zero-byte Files After Performing "G…
TFS "Branch on Checkout"
VSS Migration hanging TF60047 - how to m…
VS2003 with TFS MSSCCI shows the wrong f…

Recommend Articles

How to select a custom SC path when crea…
Cannot Delete or Move
Get all items that changed between 2 dates
Checking in Solution not including all f…
"retiring" or locking a branch…
checkin policy question
Unable to add code to Source Control (to…
Version control for web site
Binding trouble when migrating VS2003 So…
VSSConverter : how long?
TFS + ASP.NET Web Projects + Satellite A…
Problems with QueryLabels
Version Conflicts during Merge
Team Projects Check-in Policy for manage…
Checking in Enterprise Library