The problem is not really C # - it is a hosting process in the OS. Since one process can only load DLL files with the same "bit", either the process is 64 bits, or you cannot directly load your DLL. No matter what language or framework you use.
One solution would be to aim the C # project to use "any" processor, or specifically point it to X64.
Another solution would be to create a hosting process with which you can communicate using IPC or similar models.
source share