Upgrading dependent DLL without recompiling the whole application

£可爱£侵袭症+ 提交于 2020-01-10 19:51:45

问题


We have windows service application which is using Aspose.Words.NET version 11.10.0 Now we have recently upgraded the Aspose.Words dll version latest 13.7.0

Since we have already deployed our windows service applications in multiple clients, we tried replacing the old Aspose.Words dll with latest its latest version. But when we restart the existing windows application it doesn't work with the replaced latest Aspose.Words dll.

We have resolved it by recompiling the whole windows application referencing the latest version of Aspose.Words dll. Are we required to recompile and redeploy our whole windows service application every time we upgrade the Aspose.Words dll?


回答1:


Check this answer on SO too.

You need to update the config files of the desktop/web clients as follows.

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <publisherPolicy apply="no" />
        <assemblyIdentity name="Aspose.Words"  publicKeyToken="716fcc553a201e56" />
        <bindingRedirect oldVersion="11.0.0.0-13.6.0.0"
                         newVersion="13.7.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Please also note that there might be breaking changes in API which might lead to other errors. For example a method or property which existed in 11.0 is deleted in 13.7. The exception will be thrown when the client application calls the specific method/property. So, you must verify in development environment that the new version will not break your application. If it works, then you can just replace the old DLL with new version.

The config file is loaded at runtime, so you can update the config files where your applications are deployed.

I work for Aspose as a Developer Evangelist.



来源:https://stackoverflow.com/questions/18757495/upgrading-dependent-dll-without-recompiling-the-whole-application

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