5

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...

bryanmac
  • 38,941
  • 11
  • 91
  • 99
M.R.
  • 4,737
  • 3
  • 37
  • 81
  • Can you give us more information on the exception? Also, maybe your problem is related to [this question](http://stackoverflow.com/questions/12643654/could-not-load-file-or-assembly-microsoft-teamfoundation-workitemtracking-clien). – Styxxy Dec 13 '12 at 23:32
  • All I have is this: Could not load file or assembly 'Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. – M.R. Dec 13 '12 at 23:35
  • i would suggest that you run this through reflector or similar on a machine that doesn't have TFS installed and go through the references, it will Pop and ask you for what is missing – Paul Farry Dec 13 '12 at 23:51
  • I know what is missing already, its just a matter of finding why... – M.R. Dec 14 '12 at 00:14
  • What do you think is actually missing then? Microsoft.TeamFoundation.Client? If so, it shouldn't be too hard. If not, you probably are in for "one of its dependencies". – Grimace of Despair Dec 14 '12 at 00:18
  • I'm thinking it can't find a reference to the DLL, which is already on the server, but probably not in the GAC. I didn't think it needed to be in the GAC, because the other DLLs don't... so not sure.. – M.R. Dec 14 '12 at 00:32

1 Answers1

7

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.

bryanmac
  • 38,941
  • 11
  • 91
  • 99
  • Perfect. I needed a way to get the DLLs there without having to copy them over manually...for whatever reason, its not seeing the DLLs I copied, but once I installed this, it saw it... – M.R. Dec 14 '12 at 00:58
  • No links please, write the answer here. – Luca Ziegler Oct 28 '16 at 09:32
  • @LucaZiegler - this is a full answer. The answer aggregates links to the downloads. – bryanmac Oct 29 '16 at 02:45