I would like my application to be deployed with both native 32 and 64 bit versions of your assembly, and select the appropriate one dynamically. I do not want to build separate assemblies 32 and 64bit platforms. I had hoped you'd have an Any CPU version of your assembly, which would make this scenario very easy for me. It appears that's not the case, so I'll have to try and find out how to resolve the assembly dynamically. It appears I need help with that...
So I thought, I'll just reference both assemblies in my application. I quickly ran into build errors, which I resolved by adding assembly aliases and extern alias importing them. I then thought to use a dynamic variable to hold whichever version of the main class were selected by testing Is64BitProcess or whatever the method was named. That made it build, but uppon starting the application it broke down in the runtime. It appears that if I have any instances of classes from the 32bit assembly my application breaks down in the runtime.
So, I'm guessing I must make sure that only the correct assembly loads. I did some looking around, and it appears I could make a bootstrapper, and initialize a custom assembly resolver. It doesn't look too bad I guess, but it just seems amazing to me if there is no standardized way to do this. I mean, wouldn't this be a pretty common scenario? 32 and 64bit versions of the same namespace, and select the correct assembly!
Here are the examples I looked at describing the bootstrapper and assembly resolver:
http://stackoverflow.com/questions/108971/using-side-by-side-assemblies-to-load-the-x64-or-x32-version-of-a-dll
http://stackoverflow.com/questions/1159192/howto-load-assemby-at-runtime-before-assemblyresolve-event
Any insight in how to do this by turning the correct setting or whatever would be much appreciated. Thanks!
