Asp.net website DLL versioning
We have a DotNetNuke application for which we build a number of modules and lately it seems a specific problem keeps coming up.
- The modules we build make use of a third party DLL from Telerik.
- Some of the older modules use the DLL that targets .net 2.0 whilst others use the DLL that targets .net 3.5
- We now get conflicts with the older modules, because we loaded the 3.5 DLL into the bin directory of the website and this obvi开发者_开发百科ously happens because previous modules were built against the previous DLL.
What we can't afford to do is to go back to all the previous modules and update those projects and rebuild them every time we have a slight DLL difference, because ultimately the two versions of the DLL do the exact same thing.
Is it possible to remove the version information from the reference in a project so that it will automatically assume to use whatever version is available in the project within which it is being used?
Regards, Jacques
This can be achieved by using Assembly Binding Redirection. Basically, you create a configuration section in Web.config, that basically says: "When requesting these versions of an assembly, use this specific version".
it's not possible to remove version information from reference. Instead of that, you can use BindingRedirect in web.config. Basically as it's name suggest is a reference redirector and when your 2.0 modules search for telerik dll version that is of some older number, you can redirect it to newer version.
This will work only if everything except the version number in dll is different
精彩评论