Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependency management with TFS 2010

What is the best way to manage dependencies with TFS 2010 ?

EDIT: I would like to know if there is a system such as Maven or NuGet which allows to easily manage dependencies of .dll (externals or created by our team) inside TFS 2010. However we face the problem that we want to be able to modify the code of our dll and test in real time if they work (without publishing a new package).

like image 200
alexandrekow Avatar asked Jun 20 '11 17:06

alexandrekow


People also ask

How do I add a solution to TFS source control?

To add projects to source control For guidance on how to structure folders, see How To: Structure Your Source Control Folders in Team Foundation Server. Open the solution in Visual Studio 2010. In the Solution Explorer window, right-click the solution, and then click Add Solution to Source Control.

How do I add a project to TFS in Visual Studio?

In the Team Explorer window, right-click the team project collection, and then click New Team Project. In the New Team Project dialog box, provide a name and a description for the team project, and then click Next.

What is build definition in TFS?

A build definition is the mechanism that controls how and when builds occur for team projects in TFS. Each build definition specifies: The things you want to build, like Visual Studio solution files or custom Microsoft Build Engine (MSBuild) project files.


2 Answers

It's actually pretty easy to invoke NuGet as a pre-build step. You can override the BeforeBuild target in your *.*proj file for the project with NuGet references.

<Target Name="BeforeBuild">
  <Exec Command="&quot;$(SolutionDir)Tools\nuget&quot; install &quot;$(ProjectDir)packages.config&quot; -o &quot;$(SolutionDir)Packages&quot;" Condition="'$(BuildingInsideVisualStudio)'==''" />
</Target>

As implied by the snippet above, you'll want to download the NuGet command line utility, place it in a folder beneath your solution folder, and check it into version control. Note that the executable you download is actually a bootstrapper that you'll want to run once to download the real executable.

Next you'll want to check in the packages.config file from your project directory, but not the packages folder beneath your solution directory. Note that I've included a check for $(BuildingInsideVisualStudio) to not be set in the pre-build step above. This will cause the packages to be downloaded and installed at build-time when building with the TFS build service (or from the command line). It won't affect your NuGet experience inside Visual Studio.

You can search for articles on automating the creation of NuGet packages with TFS - quite a few people have blogged about it. The combination of the two makes for a very capable dependency management solution. Now we just need a NuGet feed built into TFS ;).

like image 89
Jim Lamb Avatar answered Sep 28 '22 16:09

Jim Lamb


If your question relates to managing external project dependencies of a common base lib you're building yourself, some people call this subsystem branching or dependency replication.

Here's three links to articles that handle this subject:

http://geekswithblogs.net/terje/archive/2008/11/02/article-on-subsystem-branching.aspx

http://blog.ehn.nu/2009/03/implementing-dependency-replication-with-tfs-team-build/

http://blog.ehn.nu/2010/12/dependency-replication-with-tfs-2010-build/

I just happened to have these at hand since I'm looking for a way to handle this stuff myself just now.

like image 44
takrl Avatar answered Sep 28 '22 16:09

takrl