在某些客户端使用版本 11 而不是版本 10 的情况下,我使用 bindingRedirect 将 TFS 程序集从版本 10 重定向到版本 11。该应用程序是使用 TFS v10 DLL 编译的。
<dependentAssembly>
<assemblyIdentity name="Microsoft.TeamFoundation.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.65535.65535.65535" newVersion="11.0.0.0" />
</dependentAssembly>
问题是,如果客户端使用的是 TFS 版本 11 而不是 TFS 版本 10,则重定向工作正常。如果客户端使用的是 TFS v10 而不是 TFS v11,则会出现运行时错误:
Could not load file or assembly, :microsoft.TeamFoundation.Common, Version=11.0.0.0, ... etc.
如果版本 11 不可用,应用程序是否应该回退使用 DLL 的 v10?
最佳答案
Shouldn't the application fallback to use v10 of the dll's if version 11 are not available???
不,因为您在配置文件中指定了绑定(bind)重定向。
关于c# - 当新版本不存在时使用 <bindingRedirect> 到新版本的程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11958045/