views:

65

answers:

2

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

+2  A: 

It sounds like you're including the x86-only version of the SQLCE DLLs. You should include the x64 ones also.

David Pfeffer
+1  A: 

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 x86 rather than Any CPU (via Project properties / Build / Platform target).

RichieHindle
Here's the thing.. Under platform the only option is ANY CPU.
Tyler
@Tyler: Yow, sorry, I don't know what's causing that...
RichieHindle
This worked after I created a new project and transferred my old project to Visual Studio 2010.
Tyler