升级依赖DLL而不重新编译整个应用程序 [英] Upgrading dependent DLL without recompiling the whole application

查看:180
本文介绍了升级依赖DLL而不重新编译整个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有使用Aspose.Words.NET版本11.10.0的Windows服务应用程序现在我们最近升级了Aspose.Words dll版本最新的13.7.0



由于我们已经在多个客户端部署了我们的Windows服务应用程序,所以我们尝试用最新版本替换旧的Aspose.Words dll。但是当我们重新启动现有的Windows应用程序时,它不能与替换的最新Aspose.Words dll一起使用。



我们已经通过重新编译引用最新版本的Aspose.Words dll的整个Windows应用程序来解决它。我们需要在每次升级Aspose.Words dll时重新编译和重新部署整个Windows服务应用程序?

解决方案

检查这个答案在SO



您需要按照以下方式更新桌面/网络客户端的配置文件。

 <结构> 
<运行时>
< assemblyBinding xmlns =urn:schemas-microsoft-com:asm.v1>
< dependentAssembly>
< publisherPolicy apply =no/>
< assemblyIdentity name =Aspose.WordspublicKeyToken =716fcc553a201e56/>
< bindingRedirect oldVersion =11.0.0.0-13.6.0.0
newVersion =13.7.0.0/>
< / dependentAssembly>
< / assemblyBinding>
< / runtime>
< / configuration>

还请注意,API可能会发生变化,从而导致其他错误。例如,11.7中存在的方法或属性在13.7中被删除。当客户端应用程序调用特定的方法/属性时,将抛出异常。所以,您必须在开发环境中验证新版本不会破坏您的应用程序。如果它工作,那么你可以用新版本替换旧的DLL。



配置文件在运行时加载,所以你可以更新应用程序的配置文件部署。



我为Aspose作为开发者传播者工作。


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?

解决方案

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.

这篇关于升级依赖DLL而不重新编译整个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆