views:

239

answers:

3

SqlServerCe doesn't seem be supported in .net 4.0. But since I needed an embedded database in my application, I gathered all the necessary 3.5 dlls and included them so that my wpf application could use SqlServerCe as its embedded database.

The application works on my development machine, but now that I've created an installer, and am installing the application on other machines, I keep getting this exception on hose machines:


Unable to load DLL 'sqlceme35.dll': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)


That dll is definitely included in directory where the application is installed. I've even tried copying all related SqlServerCE dlls to the System 32 folder. Nothing I've tried so far has resolved the problem.

Any suggestions?

+1  A: 

I just recompiled an app I have that uses SQL Server CE 3.5.1 in .NET 4.0 and it works just fine. Here are a few things to check:

  1. Are you including all of the SQL Server CE DLLs in your installer? There are 7, not just 1. The others are native DLLs which are the actual core of SQL Server CE.
  2. SQL Server CE has x86 and x64 version DLLs. Are you using the correct version for the OS you are installing on?
Joe Doyle
I'm just installing on 32bit right now. Here are the dlls I have included:|-- System.Data.SqlServerCe.Entity.dll|-- System.Data.SqlServerCe.dll|-- dpDatabase.sdf|-- sqlceca35.dll|-- sqlcecompact35.dll|-- sqlceer35EN.dll|-- sqlceme35.dll|-- sqlceoledb35.dll|-- sqlceqp35.dll|-- sqlcese35.dll
LonnieBest
I gave you the check, but my solution is below:
LonnieBest
+1  A: 

I resolved my problem by installing:

Microsoft SQL Server Compact 3.5 Service Pack 2 Beta 2 for Windows Desktop:

LonnieBest
+1  A: 

I solved the problem by installing the Microsoft Visual C++ 2008 Redistributable Package (x86)

tst