我有一個在GAC中註冊了幾個版本的程序集。現在,我想讓我的一個使用此程序集(版本1.3)的客戶端指向最新版本(1.4),而無需打開源代碼並重新編譯客戶端。
我看到一篇文章表明這樣做使用應用程序配置文件(WinForm應用程序)C#如何使用應用程序配置文件重定向程序集加載
這裏的技術是配置文件內容:
<?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>
正如你所看到的,是有約束力的重定向版本號爲1.3.0.0
至1.4.0.0
,組件名稱爲MyFacade
。
現在,這種方法只有一個小問題。它不工作:)
我敢肯定這是我的代碼。
有什麼建議嗎?
感謝,
阿迪巴爾達
使用fuslogvw.exe查看CLR正在考慮的內容。 – 2010-05-31 15:43:30