koobi
koobi

Reputation: 181

Always picking up the latest dll from the GAC

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?

Upvotes: 4

Views: 339

Answers (2)

Hans Passant
Hans Passant

Reputation: 942109

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

Upvotes: 2

Mike Cole
Mike Cole

Reputation: 14743

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>

Upvotes: 2

Related Questions