I ran into an issue today because I am developing an application in Visual Studio on a machine that is 32bit. When I build the application and run on a 64bit it errors out.
I am using SQL Server Compact 3.5 to store a database. I throw the DLLs for SQL Compact 3.5 into the assembly so when it is installed, those DLLs come with it. Is there a specific way I should build the project so it will work in 64bit?
Note : I get error : “System.BadImageFormatException” on the 64bit Machine
According to some googleing I should be able to change the Target CPU under Advanced Build Options but its not there in VS 2008
David’s solution is correct, but if for some reason you’re forced to use 32-bit DLLs then you should mark your code as targeting
x86rather thanAny CPU(via Project properties / Build / Platform target).