Let's say I'd like to use LZ4mm.dll, I'm developing on 64-bit platform but I would like to run application on any platform (x86 or x64).

The recipe to load correct assemblies into AnyCPU processor:

find out which platform you are running against when running AnyCPU on your development machine (x86 or x64)

reference the .dll which matches you development environment (the LZ4mm.dll from
\release\x86 or \release\x64)

include AutoLoad3264 class in your main executable (source below)

put AutoLoad3264.Register("LZ4mm"); in your
Main() method

On release:

delete LZ4mm.dll from release folder

copy LZ4mm.x86.dll and LZ4mm.x64.dll from .\release\any to your release folder

done!

How it works?
Because we deleted LZ4mm.dll application cannot find it when it's needed. It raises
AssemblyResolve event in such cases and we are handling it by loading
LZ4mm.x86.dll or LZ4mm.x64.dll accordingly to current platform.