【发布时间】:2011-02-25 22:22:00
【问题描述】:
我有一个在 GAC 中注册的版本很少的程序集。现在,我希望我的一个使用此程序集(1.3 版)的客户端指向最新版本(1.4),而无需打开源代码并重新编译客户端。
我看到一篇文章演示了使用应用程序配置文件(winform 应用程序)这样做的技术
这里是配置文件内容:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:asm="urn:schemas-microsoft-com:asm.v1">
<runtime>
<asm:assemblyBinding>
<!-- one dependentAssembly per unique assembly name -->
<asm:dependentAssembly>
<asm:assemblyIdentity
name="MyFacade"
publicKeyToken="c9c18e16df1654e0" />
<!-- one bindingRedirect per redirection -->
<asm:bindingRedirect oldVersion="1.3.0.0"
newVersion="1.4.0.0" />
</asm:dependentAssembly>
</asm:assemblyBinding>
</runtime>
</configuration>
如您所见,对于名为 MyFacade 的程序集,存在从版本 1.3.0.0 到 1.4.0.0 的绑定重定向。
现在,这种方法只有一个小问题。它不起作用:)
我确定这与我的代码有关。
有什么建议吗?
谢谢,
阿迪巴尔达
【问题讨论】:
-
使用 fuslogvw.exe 查看 CLR 正在考虑什么。
标签: c# winforms versioning gac app-config