Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Team Foundation Server DLL as a reference in class library

I created a windows service to interact with a TFS server, and it is working fine on my local machine. In order to make this work, I had to add references to Microsoft.TeamFoundation.Client.dll - I copied this file from my TFS installation on my local machine, and then added it in a folder and then added the references to the dll from my project.

Now I need to deploy on the server, and I thought copying the dll on the server on the same level as the .exe would be enough. But it keeps saying that Could not load file or assembly 'Microsoft.TeamFoundation.Client

What do I need to do here?

EDIT: OK, so I found that the microsoft dll is 32 bit, while the server is 64 bit. I changed my service target to be 32 bit also, and I still have the same problem...

like image 462
M.R. Avatar asked Dec 13 '12 23:12

M.R.


1 Answers

The Team Foundation Server object model (client assemblies) are installed in the GAC (along with it's other dependencies). They are distributed as part of Visual Studio and the team explorer SKU which is the supported way to consume them as a redist.

Recently the object model was also made available as a separate installer:

http://visualstudiogallery.msdn.microsoft.com/a37e19fb-3052-4fc9-bef7-4a4682069a75

That's for the 2010 OM. I believe the 2012 OM installer is in the works.

Here's a related link:

http://blogs.msdn.com/b/buckh/archive/2012/07/14/standalone-installer-for-the-tfs-client-object-model.aspx

If you must have 2012 OM before it's released as a separate sku, the workaround is to use the team explorer sku available here:

http://www.microsoft.com/en-us/download/details.aspx?id=30656

UPDATE: 2012 OM redist here: http://visualstudiogallery.msdn.microsoft.com/f30e5cc7-036e-449c-a541-d522299445aa

UPDATE: In 2015, OM is no longer in the GAC. Moving to a nuget package to consume.

like image 125
bryanmac Avatar answered Oct 15 '22 11:10

bryanmac