【发布时间】:2010-10-02 21:36:55
【问题描述】:
哪里是查找绑定重定向信息的最佳位置?或者只是对您在项目中放置这些重定向的位置的基本解释?
【问题讨论】:
哪里是查找绑定重定向信息的最佳位置?或者只是对您在项目中放置这些重定向的位置的基本解释?
【问题讨论】:
你放的地方只能是配置。查找详情here。
【讨论】:
有几个configuration files 可以包含绑定重定向。除了配置文件之外的另一个选项是使用AppDomain.AssemblyResolve 事件在运行时决定重定向。我在this answer 中包含了一些示例代码。
【讨论】:
为什么不从beginning开始呢?
在理解了它的作用之后,你最终会得到类似的东西:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0"
newVersion="2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
【讨论】: