Pero P.
Pero P.

Reputation: 26992

Incorrect binding redirect in TFS 2015 TFSBuildServiceHost.exe.config

After upgrading a XAML build server from TFS 2013 Update 4 to TFS 2015 Update 1, some XAML builds based on older templates started to fail with the following error:

TF215097: An error occurred while initializing a build for build definition : Exception Message: Could not load file or assembly 'Microsoft.TeamFoundation, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (type FileNotFoundException) Exception Stack Trace:

....

Inner Exception Details:

Exception Message: Could not load file or assembly 'Microsoft.TeamFoundation, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (type FileNotFoundException)

This is despite Microsoft.TeamFoundation, Version=11.0.0.0 existing in the GAC and the builds having functioned fine with TFS 2013. Taking a look at TFSBuildServiceHost.exe.config the following binding redirect has been introduced in TFS 2015:

<dependentAssembly>
  <assemblyIdentity name="Microsoft.TeamFoundation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  <bindingRedirect oldVersion="10.0.0.0-12.9.0.0" newVersion="14.0.0.0"/>
</dependentAssembly>

The problem here is that Microsoft.TeamFoundation.dll does not exist post version 11.0.0.0. My understanding is that all namespaces in Microsoft.TeamFoundation were merged into Microsoft.TeamFoundation.Common in TFS 2013. The binding redirect is redirecting to a version of an assembly that does not exist.

Removing the redirect allows the builds to succeed.

Is this as a bug?

Upvotes: 1

Views: 687

Answers (1)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51153

I think it's not a bug. Since you have upgraded a XAML build server from TFS 2013 Update 4 to TFS 2015 Update 1. So, it will redirect all the old dll version to the new 14.0.0.0 just like you see.

<dependentAssembly>
  <assemblyIdentity name="Microsoft.TeamFoundation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  <bindingRedirect oldVersion="10.0.0.0-12.9.0.0" newVersion="14.0.0.0"/>
</dependentAssembly>

And to upgrade your build definitions. You have to recompile any custom activity assemblies that this build machine uses to target new net framework. Since there is no Microsoft.TeamFoundation.dll=14.0.0.0 You need to delete the reference of this dll in old build definition and refer to a new one which have 14.0.0.0 version. More details you can check this MSDN blog: Upgrading your build definitions from TFS2010 to TFS2012

Upvotes: 0

Related Questions