.net dll version issue when replacing one dll

◇◆丶佛笑我妖孽 提交于 2019-12-07 08:12:25

问题


I have the following problem. I created software, containing several projects in one solution. When I fix a bug in one of my projects which doesn't change how functions behave, (For example a simple string change, or an extra try/catch block within a function) I must recompile and provide all my dll's again, because when I only provide the changed dll, the version doesn't match. I understand that the problem is due to the fact that my dll's are strongly named. But is there any way to accomplish that I can just replace the changed dll, while the version number is raised, without changing and distributing the other dll's?


回答1:


You can have both dlls and can use bindingRedirect as in below link

dll versioning in dotnet

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="AssemblyName"
                              publicKeyToken="32ab4ba45e0a69a1"
                              culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0"
                             newVersion="2.0.0.0"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>


来源:https://stackoverflow.com/questions/7321511/net-dll-version-issue-when-replacing-one-dll

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