Search code examples
dlltfsprojects-and-solutions

Where in the TFS project structure should common libraries be put?


Some time back our group started work on a website project which referenced a DAL project that we housed in the same solution as the website. Since that time we have created some web services, and a couple of client applications that use the same library.

The DAL project still resides in the website solution, and so other solutions have to traverse into the website solutions folder structure to include it.

How are shared projects stored so that they make sense from a multi-solution standpoint? Should my DAL be in its own solution, sitting on equal directory footing with the other solutions that use it, or should it just be a free-floating project that sits outside of a solution folder?

I really want to implement a way that will work when we do this 3 or 4 more times later on because we all know that today's hacked on feature gets 10 flavors requested tomorrow.


Solution

  • Here's how I generally like to set things up:

    \Common
        \Library1
             .csproj and other files for Library1
        \Library2
             .csproj and other files for Library2
    \Services
        \ServiceProject1
             .csproj and other files for ServiceProject1
             .sln which references ServiceProject1.csproj, Library1.csproj, and Library2.csproj
        \ServiceProject2
             .csproj and other files for ServiceProject2
             .sln which references ServiceProject3.csproj, Library1.csproj, and Library2.csproj
    \Clients
        \WebProject1
             .csproj and other files for WebProject1
             .sln which references WebProject1.csproj, Library1.csproj, and Library2.csproj
        \WinFormsProject1
             .csproj and other files for WinFormsProject1
             .sln which references WinFormsProject1.csproj, Library1.csproj, and Library2.csproj
    AllProjects.sln which references all .csproj files for when you need to do refactorings,  architecture diagrams, etc at a global level