Binding redirects

随声附和 提交于 2020-02-22 08:01:05

问题


Where is the best place to find information on binding redirects? or maybe just a basic explanation of where you put these redirects within a project?


回答1:


Where you put it can only be configuration. Find details here.




回答2:


Why not start from the beginning?

after understood what it does, you will end up with something like:

<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>



回答3:


There are several configuration files that can include binding redirects. Another option besides the configuration files is to use the AppDomain.AssemblyResolve event to decide on redirects at run time. I've included some sample code in this answer.



来源:https://stackoverflow.com/questions/468825/binding-redirects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!