How not to require a specific build version

I have a project that I'm working on that references an assembly that references an assembly, for example:

Me |- A | |- B v1.4.2 | |- B v1.5 

A does not need to refer only to 1.4.2 , just to something more than 1.4 or so on. In the properties for the links, A B says "Specific version = False", but when I start Me with B v1.5 , I get a FileLoadException to search for B v1.4.2 . However, B v1.5 present, how can I reduce the CLR?

+4
source share
1 answer

Although linking redirects is the way here, sometimes it is not possible, i.e. if you download the plugin in another exe. The practical decision we made was to bind the AppDomain.CurrentDomain.AssemblyResolve event, listen for the failed binding to myassembly1.4.2.dll (for example), and explicitly return the assembly returned by calling System.Reflection.Assembly.LoadFrom("c:\assemblies\myassembly.1.5.0.dll") . It’s better to forward the forwarding, but sometimes it’s not practical.

+2
source

All Articles