Problem using SqlServerCe in .Net 4.0

2

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?

c#
.net-4.0
sql-server-ce
asked on Stack Overflow Mar 5, 2010 by Lonnie Best • edited Mar 8, 2010 by Lonnie Best

4 Answers

1

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?
answered on Stack Overflow Mar 5, 2010 by Joe Doyle • edited Mar 5, 2010 by Joe Doyle
1

I resolved my problem by installing:

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

answered on Stack Overflow Mar 8, 2010 by Lonnie Best
1

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

answered on Stack Overflow Aug 6, 2010 by tst
0

In my case the Microsoft.VC90.CRT.manifest from \bin\amd64\Microsoft.VC90.CRT respectively \bin\x86\Microsoft.VC90.CRT was missing. When deploying your solution, it isn't part of the release by default but on some servers it seems to be necessary.

answered on Stack Overflow Dec 10, 2012 by Philipp Michael

User contributions licensed under CC BY-SA 3.0