【问题标题】:Binding redirects绑定重定向
【发布时间】:2010-10-02 21:36:55
【问题描述】:

哪里是查找绑定重定向信息的最佳位置?或者只是对您在项目中放置这些重定向的位置的基本解释?

【问题讨论】:

    标签: c# binding redirect


    【解决方案1】:

    你放的地方只能是配置。查找详情here

    【讨论】:

      【解决方案2】:

      有几个configuration files 可以包含绑定重定向。除了配置文件之外的另一个选项是使用AppDomain.AssemblyResolve 事件在运行时决定重定向。我在this answer 中包含了一些示例代码。

      【讨论】:

        【解决方案3】:

        为什么不从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>
        

        【讨论】:

        猜你喜欢
        • 2011-04-25
        • 2016-10-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-02-11
        • 2018-06-09
        • 2016-01-22
        • 2014-03-20
        相关资源
        最近更新 更多