Lee Warner
Lee Warner

Reputation: 2593

Define a .net reference to always use the latest version of a GAC'd dll?

We have a vendor who is writing an application for us who makes use of a dll I've provided to them. My boss just found out that if we ever need to make a change to one of our dll's we'd have to provide the updated version to the vendor so they could recompile their project. This causes problems because we don't have automated testing and any new build would require a complete run-through by our QA department.

I've not done too much with the GAC before but believe it could be what we're looking for. Is there a way I could deploy my dll (the one I provide to the vendor) to the GAC and have the vendor build their .net project in such a way as to always grab the latest version from the GAC?

Upvotes: 4

Views: 2140

Answers (2)

to StackOverflow
to StackOverflow

Reputation: 124776

If you have made a breaking change in your DLL, you will of course need to ship the new version so your vendor can compile with it.

But otherwise there is no need for the vendor to have the latest version. Instead you can use Assembly Binding Redirection to ensure you are using the most appropriate (usually latest) version at runtime.

There are several ways to achieve this as described in the linked article - the most common is to use settings in the application configuration file (if you only want to affect this application) or a publisher policy file (if you want to affect all applications that use the shared assembly).

Upvotes: 1

Adam Robinson
Adam Robinson

Reputation: 185683

They will need to set the SpecificVersion property of the reference to false in the project that they're compiling. See this question and the article that it links to.

Upvotes: 4

Related Questions