I need to reference the DLL, which is available in two versions (one for 32-bit and one for 64-bit). My goal is to create a web application that runs on both 32 and 64-bit systems.
I was thinking of referencing the default 32-bit assembly and using the AssemblyResolve event to load the 64-bit version (if the 32-bit version failed to load):
static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += _AssemblyResolve;
But even if a BadImageFormatException error occurs, the _AssemblyResolve handler will not be called. Is there any other way to achieve the proposed behavior?
source share