I have inherited a program that writes software documents for projects using information pulled from TFS. It was written way back using Visual Studio 2010. I am trying to get the program to work without the need to install Visual Studio 2010. When attempting to run the program with VS 2015 or later installed, I first get this error:
BadImageFormatException: Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore, Version=10.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. An attempt was made to load a program with an incorrect format.
that stems from this method:
public WorkItemStore GetworkItemStore()
{
WorkItemStore _tfs = new WorkItemStore(m_TeamProjectCollection);
return _tfs;
}
This error comes when it first makes an attempt at connecting to TFS. Installing VS 2010 allows the program to run properly without any issues, however, putting VS 2010 on every machine that will be used to run this program is not an option.
My question is what is installed with VS 2010 that is not available, or has changed, in later versions of VS to allow this program to connect with TFS?
The WorkItemStore
use Microsoft.TeamFoundation.WorkItemTracking.Client
, the easy way to get it is to install the Microsoft.TeamFoundationServer.ExtendedClient.
It will install many DLLs that maybe you don't need so you can install it in a new project and just take the WorkItemTracking.Client
to your project (add it as a reference).
If you need a specific version of the DLL, you can go to PC that has VS 2012 and the program works, take the DLL from the project folder and copy to the other computers.
When you have the DLL referenced to the project you can run the program in any VS version.