Skip to content

C#: Compile app in x64 (64bit) and linking with x86 (32bit) DLL

March 24, 2017

When compile a C# app and linking with x86 (32bit) DLL, got this error: “That error is the Win32 error ERROR_BAD_EXE_FORMAT” or similar error. This occur when your DLL is x86 (32bit) platform and your is x64 (64bit) platform. To solve this problem, add platform switch at csc.exe command:

Type this at your command line:
csc /platform:x86 HelloWorld.cs

This command save me when I got that problem. I was working on app development for RFID / smartcard project. The RFID is ACR120U. The reader drivers (DLL) was compiled using  x86 platform but my laptop is x64 platform. I dont want to use new reader because my organization got too many stock for this reader (ACR120U).

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: