Phil Chayer
Phil Chayer

Reputation: 3

Sharing project in TFS

We are trying to figure a way to setup TFS for our needs. We have, let's say, Project A, Project B and Framework, a project shared by many projects.

Framework

Project A - Framework

Project B - Framework

If the Framework is modified, we want to make sure that every project that use it has the last version.

We first thought about sharing the Framework by adding it to project A and B using "Add as link" in Visual Studio, but this would also modify all branches, which is not good. So we thought about compiling Framework into a DLL and include a copy of this DLL into each project. The drawback is that the DLL has to be updated manually for each project.

What is the best way to share a project in TFS?

Upvotes: 0

Views: 45

Answers (2)

rerwinX
rerwinX

Reputation: 2035

There is no 'sharing' as such in TFS as-in the way you could with Visual SourceSafe. You have 3 options

  1. Use branching and merging. You branch Framework into Project A and Project B. If changes are made to the framework, the project teams will have to merge them into their project. If they make changes to Framework in their project then they will have to merge back to Framework to allow other projects to consume the changes.

  2. Use Workspace Mappings. Essentially this is setting up sharing. When I do a get on my ProjectA workspace, it would also get the code in Framework to a subdirectory that I can reference in ProjectA. Any changes would be propagated to Framework and all the projects as soon as they did a get latest.

  3. And probably the best solution is to use something like nuget. Your Framework build would package and publish the latest version which would then be consumed by the Projects. You could choose to stick with a version or pull the latest at build time.

TFVC Gems - should cover the first 2 options

Dependency Management with NuGet.pdf - talks about option 3

Upvotes: 1

Paul Michaels
Paul Michaels

Reputation: 16695

I'm assuming that we're talking about a .NET set-up, if not then this might not be relevant.

I believe that if you have a reference to the framework project (rather than the compiled DLL), then every time you recompile your projects, you will pick up the latest version of Framework (obviously, this is dependant on your branching structure).

Another thing to consider, if the above doesn't work, is to use a build to recompile the dependencies first.

Upvotes: 0

Related Questions