开发者

Problem using SqlServerCe in .Net 4.0

开发者 https://www.devze.com 2022-12-22 05:21 出处:网络
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

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 开发者_JS百科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?


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?


I resolved my problem by installing:

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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号