Always picking up the latest dll from the GAC

ε祈祈猫儿з 提交于 2019-12-10 16:19:36

问题


We have a dll with version 1.0.1.* that is used by many applications whcih themselves run on different machines. This dll resides in the GAC of the machine running the application. The application includes this dll as a reference with "Specific Version" set to false. We have come up with version 1.0.2.* of this dll which is backward compatible.

Is there a way to deploy the new dll and ask all the applications to pick the latest version without having to recompile the applications. I am aware of assembly redirection using Publisher Policy. Is there another way?


回答1:


A publisher policy is explicitly designed to do this, not considering it to solve your problem doesn't make a lot of sense. Given that your update is 'backward compatible', a no-hassle approach would be to simply not change the [AssemblyVersion] but only increment the [AssemblyFileVersion].




回答2:


You can add a new AssemblyBinding element in your web.config:

<dependentAssembly>
  <assemblyIdentity name="NHibernate" publicKeyToken="AA95F207798DFDB4" culture="neutral" />
  <bindingRedirect oldVersion="1.0.0.0-2.1.1.4000" newVersion="2.1.2.4000" />
</dependentAssembly>


来源:https://stackoverflow.com/questions/5170084/always-picking-up-the-latest-dll-from-the-gac

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