Looking for a preprocessor directive in c# for importing dll based on whether the executable is 64bit or 32 bit:
#if WIN64
[DllImport(\"ZLIB64.dll\", Calling
There is nothing builtin that I am aware of. However, it is simple to define a custom compilation constant. If you are using Visual Studio create different build configurations for 32bit and 64bit versions using the Configuration Manager. Then open the project properties and go to the Build tab and enter a descriptive name in the conditional compilation symbols textbox for each build configuration. Then you can reference the compilation constants in code.