Reputation: 3384
I have a C#/.NET 4.0 project which is a DLL library that contains some custom activities for a TFS 2010 build workflow. The project compiles and everything works on our development boxes.
On our build server we recently installed Visual Studio 2012 and found out that our builds now fail with this error
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Client.dll: Assembly 'Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'Microsoft.TeamFoundation.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'Microsoft.TeamFoundation.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I have searched high and low and can not find how/why all the calls to Microsoft.TeamFoundation.Client.dll which resolve to v 10.0.0 on our DEV boxes now resolve to 11.0.0.0 on build server. There are no assembly binding redirects that I could find, no publisher policies, nothing!
ALl I need is to force MSBuild and the build process to refer to v 10.0.0 of all related DLLs on the build server and not to v 11.0.0.0. Any help would be much appreciated.
Please note this is not related to a "XAML workflow" problem but instead compiling a DLL project that happens to reference 10.0.0.0 of Microsoft.TeamFoundation.Client.dll
Upvotes: 3
Views: 4610
Reputation: 3384
The complete explanation is now available on my blog post here
The proper way to resolve this was to ensure that MSBuild pipeline would always reliably reference the correct version of Microsoft.TeamFoundation.* dlls. After a considerable amount of investigating the solution turned out to set the SpecificVersion flag true in the .csproj file for the assemblies we wanted forced resolution to a specific version.
Upvotes: 1
Reputation: 4083
Open the .csproj for your custom activity library in notepad. Update the TFS assembly references removing the version-specific metadata.
Even if you set the "Specific Version" property to False, it still may have the version-specific metadata attached to the reference:
<Reference Include="Microsoft.TeamFoundation, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(Dependencies)\TeamFoundationClient\Microsoft.TeamFoundation.dll</HintPath>
</Reference>
Removing the metadata should get that project building correctly.
<Reference Include="Microsoft.TeamFoundation">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(Dependencies)\TeamFoundationClient\Microsoft.TeamFoundation.dll</HintPath>
</Reference>
Upvotes: 1