TFS and shared projects in multiple solutions

Posted by David Stratton on Stack Overflow See other posts from Stack Overflow or by David Stratton
Published on 2010-05-19T15:08:26Z Indexed on 2010/05/19 15:10 UTC
Read the original article Hit count: 837

Our .NET team works on projects for our company that fall into distinct categories. Some are internal web apps, some are external (publicly facing) web apps, we also have internal Windows applications for our corporate office users, and Windows Forms apps for our retail locations (stores). Of course, because we hate code reuse, we have a ton of code that is shared among the different applications. Currently we're using SVN as our source control, and we've got our repository laid out like this:

 - = folder, | = Visual Studio Solution
-SVN
   - Internet
      | Ourcompany.com
      | Oursecondcompany.com
   - Intranet
      | UniformOrdering website
      | MessageCenter website
   - Shared
      | ErrorLoggingModule
      | RegularExpressionGenerator
      | Anti-Xss
      | OrgChartModule etc...

So..

The OurCompany.com solution in the Internet folder would have a website project, and it would also include the ErrorLoggingModule, RegularExpressionGenerator, and Anti-Xss projects from the shared directory.

Similarly, our UniformOrdering website solution would have each of these projects included in the solution as well.

We prefer to have a project reference to a .dll reference because, first of all, if we need to add or fix a function in the ErrorLoggingModule while working on the OurCompany.com website, it's right there. Also, this allows us to build each solution and see if changes to shared code break any other applications. This should work well on a build server as well if I'm correct.

In SVN, there is no problem with this. SVN and Visual Studio aren't tied together in the way TFS's source control is. We never figured out how to work this type of structure in TFS when we were using it, because in TFS, the TFS project was always tied to a Visual Studio Solution. The Source Code repository was a child of the TFS Project, so if we wanted to do this, we had to duplicate the Shared code in each TFS project's source code repository. As my co-worker put it, this "breaks every known best practice about code reuse and simplicity". It was enough of a deal breaker for us that we switched to SVN.

Now, however, we're faced with truly fixing our development processes, and the Application Lifecycle Management of TFS is pretty close to exactly what we want, and how we want to work. Our one sticking point is the shared code issue.

We're evaluating other commercial and open source solutions, but since we're already paying for TFS with our MSDN Subscriptions, and TFS is pretty much exactly what we want, we'd REALLY like to find a way around this issue.

Has anybody else faced this and come up with a solution?

If you've seen an article or posting on this that you can share with me, that would help as well.

As always, I'm open to answers like "You're looking at it all wrong, bonehead, HERE'S the way it SHOULD be done.

© Stack Overflow or respective owner

Related posts about visual-studio-team-system