Viewing Build’s default template on an SxS setup


On a side-by-side setup of your VS2010 and Visual Studio vNext, viewing the build default templates on VS2010 will probably fail with errors that are similar to:

Compiler error(s) encountered processing expression “BuildDetail.BuildNumber”.
‘Microsoft.TeamFoundation.Build.Client.BuildDetail’ is not accessible in this context because it is ‘Friend’
.

To fix this issue, you will need to add the following binding redirection of a few TFS assemblies to devenv.exe.config of VS2010:

<dependentAssembly>
    <assemblyIdentity name=”Microsoft.TeamFoundation.Build.Client” publicKeyToken=”b03f5f7f11d50a3a” culture=”neutral”/>
    <bindingRedirect oldVersion=”11.0.0.0-99.9.0.0″ newVersion=”10.0.0.0″/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name=”Microsoft.TeamFoundation.Client” publicKeyToken=”b03f5f7f11d50a3a” culture=”neutral”/>
    <bindingRedirect oldVersion=”11.0.0.0-99.9.0.0″ newVersion=”10.0.0.0″/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name=”Microsoft.TeamFoundation.Common” publicKeyToken=”b03f5f7f11d50a3a” culture=”neutral”/>
    <bindingRedirect oldVersion=”11.0.0.0-99.9.0.0″ newVersion=”10.0.0.0″/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name=”Microsoft.TeamFoundation.VersionControl.Client” publicKeyToken=”b03f5f7f11d50a3a” culture=”neutral”/>
    <bindingRedirect oldVersion=”11.0.0.0-99.9.0.0″ newVersion=”10.0.0.0″/>
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name=”Microsoft.TeamFoundation.VersionControl.Common” publicKeyToken=”b03f5f7f11d50a3a” culture=”neutral”/>
    <bindingRedirect oldVersion=”11.0.0.0-99.9.0.0″ newVersion=”10.0.0.0″/>
</dependentAssembly>

The errors are the result of both versions of the same assemblies being loaded. The build default template references these assemblies just by their simple names with no version numbers. When the Common Language Runtime attempts to load them from the Global Assembly Cache, it loads both versions of the same assemblies.

As a matter of fact, it was a design decision to support build template compatibility for upgraded servers. For example, when a TFS2010 server is upgraded to the next version, existing build definitions that use the old default template can still run on the upgraded build machines that have the vNext TFS assemblies.

Comments (2)

  1. TommiR says:

    Thanks a lot for sharing this. I installed VS11 preview some time ago and recently I noticed problems when trying to view build templates in workflow editor. Removing VS11 did not help, because the 11.0 assemblies still existed in GAC. Also had to add bindingRedirect definition in devenv.exe.config for some other assemblies I am using, but based on your instructions i finally got it working. Nice!

  2. @TommiR: The experience around the WF designer is much improved in the SP1 release of VS10. I would recommend installing SP1 to mitigate the errors you have with opening build templates.