Lonnie Best
Lonnie Best

Reputation: 11344

Problem using SqlServerCe in .Net 4.0

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?

Upvotes: 2

Views: 3220

Answers (4)

Philipp Michael
Philipp Michael

Reputation: 954

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.

Upvotes: 0

tst
tst

Reputation: 11

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

Upvotes: 1

Lonnie Best
Lonnie Best

Reputation: 11344

I resolved my problem by installing:

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

Upvotes: 1

Joe Doyle
Joe Doyle

Reputation: 6383

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?

Upvotes: 1

Related Questions