I was doing some dev in VS 2008 using SQLCE for some data storage.
As soon as I put in a reference to the ce namespace and run, I get this error "Unable to load DLL 'sqlceme35.dll'. A little bit of searching around and I found that for development you need to have your app built for x86 as SQLCE only supports 32-bit. I have a 64-bit machine and all VS projects by default get built as "Any CPU", which means my exes were being built for 64-bit. As soon as I set it to x86, everything worked fine.
In Visual Basic, this option is available under My Project->Compiler->Advanced Compiler Setting
More information on this problem can be found below:
Can’t find P/Invoke DLL sqlcemeNN.dll
x64 and SQL Compact
Side Note: As per my research, SQL CE 3.5 SP1 is supposed to have native support for x64. I am not aware what version I am running on. But the version that ships with VS 2008 has this problem. When I do check out SP1, I will update this post.


Comments