Your program will be either 32-bit or 64-bit. It is not possible to execute 32-bit code in an 64-bit program, and it is not possible to execute 64-bit code in a 32-bit program. You will get a run-time exception if you try! Thus, you cannot have 1 program which executes both x86 and x64 code. You have 3 options depending on what you would like to do.
Option 1: (Original answer)
Use "Any CPU", and then your program can run as 32-bit on a 32-bit platform and 64-bit on a 64-bit platform. In that case, you can use this code to determine which DLL to use and you would only need 1 assembly to be able to handle both 32-bit and 64-bit platforms and it will use the correct dll:
use Environment.Is64BitProcess
if (Environment.Is64BitProcess)
{
//call MiniDumpWriteDump
}
else
{
//call MiniDumpWriteDumpX86
}
Option 2:
If you want to use "preprocessor" conditions to do this, then you would compile 2 different assemblies. You would compile a 32-bit assembly to be run on 32-bit platforms which uses the 32-bit DLL, and you would compile a separate 64-bit assembly to run in 64-bit platforms.
Option 3:
Use IPC(Inter-process-communications). You would have 1 64-bit program which "connects" to a 32-bit program. The 64-bit program can run the 64-bit DLL function, but when you need to run the 32-bit DLL function, you would have to send a message to the 32-bit program with the information needed to run it, and then the 32-bit program could send a response with any information that you want back.