Recently I installed an instance of TFS 2012 and TFS 2012 Build for a client. It is a simple setup with TFS 2012 on one server and TFS 2012 Build (one controller and one agent) on another server. The client is still using VS 2010 for all projects, so we installed VS 2010 on the build server to compile the projects for them. After setting this up, I created a simple test project (and MVC app) and created a simple CI build for it. Everything worked fine. We then took one of their existing projects to set up a CI build for and that worked fine. Everything is compiling and build was working great.
The next week I was coming in to conduct some training with them for Work Item usage and benefits, they told me that their build were not working. I immediately assumed that this was an issue with the code or the project and we would quickly be able to see that and trouble shoot. However, when I opened the build details, I saw the following error.
Value of type ‘Microsoft.TeamFoundation.VersionControl.Client.Workspace’ cannot be converted to ‘Microsoft.TeamFoundation.VersionControl.Client.Workspace’. Type mismatch could be due to mixing a file reference to ‘C:WindowsassemblyGAC_MSILMicrosoft.TeamFoundation.VersionControl.Client10.0.0.0__b03f5f7f11d50a3aMicrosoft.TeamFoundation.VersionControl.Client.dll’ in project ‘vbhost’ with a file reference to ‘C:WindowsassemblyGAC_MSILMicrosoft.TeamFoundation.VersionControl.Client11.0.0.0__b03f5f7f11d50a3aMicrosoft.TeamFoundation.VersionControl.Client.dll’ in project ‘vbhost’. If both assemblies are identical, try replacing these references so both references are from the same location.
This was strange. This had been working and now suddenly there was this mismatch. I logged on to the build server and low and behold, the GAC did contain the TFS v10 and TFS v11 versions of the dlls. I did what any consultant would do, I Googled the issue and came up with a couple of hits here and here. One suggested restarting the server, so I tried that. No luck. Same build failure again. I tried uninstalling the offending assembly from the GAC and (of course) failed due to permissions (than goodness). I then started to look at uninstalling VS 2010, just to get past this error and see if there was anything else going on.
In looking to uninstall VS 2010, I noticed the installed component “Microsoft Team Foundation Server 2010 Object Model”. This is installed with VS 2010 automatically and cannot be selected out of the installation. This would of course be necessary to connect up to a TSF 2010 server, however, I did not need to do that. I needed to connect to TFS 2012, so this component was now redundant and safe to remove. I uninstalled this component and reran the build successfully. I hope this can help out others with that find a similar problem.