开发者

Do I need to install Sql Server CE or not?

I've deployed an application (wcf REST service) on an hosted server and I am having problems with the fact that I want to make use of SQL Server Compact Edition in application. I know sqlce might not be intended to be used with wcf services, but it's a POC application so for now I want to use something lightweight.

My assumption was that would not have to install anything to get sqlce working as long as I included all the relevant dlls. Either this assumption is wrong, or I am doing something else wrong, either which I would appreciate the help very much.

Some more details:

  • I include all native dlls in the bin folder (sqlceme35.dll, sqlceca35.dll, sqlcecompact35.dll, etc...).
  • Everything works when I run the service locally from Visual Studio
  • Local machine is Windows7 64 bit, deployment server where it doesn't work is Windows Web Server 2008 R2 64-bit

I have run procmon.exe on the service both locally and on the server. I have noticed that my service looks in the registry for the path to the native assemblies. On my local machine it finds them, on the remote machine, it doesn't find them it seems. Even though I have included them in the bin folder. Looking at the procmon trace it seems like it never looks in the service bin folder for the assemblies, why is this? There are several tutorials out there that instructs you to put these native dlls in your bin folder, but how do I get the runtime to pick them up from there?

Thanks

Edit: This is the exception message I am getting:

Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

This is the stacktrace, don't konw if it's much help:

System.Data.SqlServerCe.NativeMethods.GetSqlCeVersionInfo(IntPtr& pwszVersion)
System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath, Int32 moduleVersion)
System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()

Here is the trace from procmon, as you can see it never looks in the local bin folder, and all other attempts result in "NOT FOUND"

19:38:19,6827870    w3wp.exe    1492    RegOpenKey  HKLM\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.5   NAME NOT FOUND  Desired Access: Read
19:38:19,6830056    w3wp.exe    1492    CreateFile  C:\Windows\System32\inetsrv\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6831212    w3wp.exe    1492    CreateFile  C:\windows\system32\inetsrv\AMD64\sqlceme35.dll PATH NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6833148    w3wp.exe    1492    CreateFile  C:\Windows\System32\inetsrv\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6834744    w3wp.exe    1492    CreateFile  C:\Windows\System32\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6837095    w3wp.exe    1492    CreateFile  C:\Windows\system\sqlceme35.dll NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6838472    w3wp.exe    1492    CreateFile  C:\Windows\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6901250    w3wp.exe    1492    CreateFile  C:\Windows\System32\inetsrv\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6908696    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Mail Enable\bin\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6911172    w3wp.exe    1492    CreateFile  C:\Windows\System32\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6913672    w3wp.exe    1492    CreateFile  C:\Windows\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6917576    w3wp.exe    1492    CreateFile  C:\Windows\System32\wbem\sqlceme35.dll  NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6922974    w3wp.exe    1492    CreateFile  C:\Windows\System32\WindowsPowerShell\v1.0\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6924935    w3wp.exe    1492    CreateFile  C:\PROGRA~2\MAILEN~1\BIN64\sqlceme35.dll    PATH NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6929665    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6941248    w3wp.exe    1492    CreateFile  C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlceme35.dll  NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6949102    w3wp.exe    1492    CreateFile  C:\Program Files\Microsoft SQL Server\100\DTS\Binn\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6957462    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6961266    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\sqlceme35.dll  NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6965371    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\sqlceme35.dll  NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6968111    w3wp.exe    1492    CreateFile  C:\Windows\assembly\GAC_MSIL\System.Data.SqlServerCe\3.5.1.0__89845dcd8080cc91\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6970427    w3wp.exe    1492    CreateFile  C:\Windows\System32\inetsrv\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6972318    w3wp.exe    1492    CreateFile  C:\Windows\System32\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6974908    w3wp.exe    1492    CreateFile  C:\Windows\system\sqlceme35.dll NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6976650    w3wp.exe    1492    CreateFile  C:\Windows\sqlceme35.dll    NAME NOT FO开发者_Go百科UND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6978616    w3wp.exe    1492    CreateFile  C:\Windows\System32\inetsrv\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6983399    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Mail Enable\bin\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6985731    w3wp.exe    1492    CreateFile  C:\Windows\System32\sqlceme35.dll   NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6987678    w3wp.exe    1492    CreateFile  C:\Windows\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6990224    w3wp.exe    1492    CreateFile  C:\Windows\System32\wbem\sqlceme35.dll  NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6993088    w3wp.exe    1492    CreateFile  C:\Windows\System32\WindowsPowerShell\v1.0\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,6994236    w3wp.exe    1492    CreateFile  C:\PROGRA~2\MAILEN~1\BIN64\sqlceme35.dll    PATH NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,7000169    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,7006810    w3wp.exe    1492    CreateFile  C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlceme35.dll  NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,7014391    w3wp.exe    1492    CreateFile  C:\Program Files\Microsoft SQL Server\100\DTS\Binn\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,7025657    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\sqlceme35.dll    NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,7034545    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\sqlceme35.dll  NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:38:19,7040690    w3wp.exe    1492    CreateFile  C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\sqlceme35.dll  NAME NOT FOUND  Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a


See this answer: Can't get sql server compact 3.5 / 4 to work with ASP .NET MVC 2

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜