1
我有2個名爲AAA(版本1.0.0.0和版本2.0.0.0)的GAC程序集。該應用程序目前正在使用版本1(通過Browse-for-assembly添加引用,路徑被硬編碼到這個文件),但我想要使用版本2.如何在C#應用程序中使用具有特定版本的GAC程序集
要順利地做到這一點,我添加了一些代碼到app.config :
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="AAA"
publicKeyToken="dd8b40231cb0196b"
culture="en-us" />
<!-- Assembly versions can be redirected in app,
publisher policy, or machine configuration files. -->
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
但是應用程序還在使用組件版本1.0.0.0,爲什麼?
你可以試試:''? –