`
laowood
  • 浏览: 119565 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Can’t find P/Invoke DLL sqlcemeNN.dll

阅读更多

Can’t find P/Invoke DLL sqlcemeNN.dll

I know this is very annoying, uninformative, directionless…blah blah… error.   And, kindly pardon me for blogging about this error very lately.   Better late than never and here it goes.

 

What are the actual errors?

1) Can't find P/Invoke DLL sqlceme30.dll

2) Can't find P/Invoke DLL sqlceme35.dll

3) Can't find P/Invoke DLL sqlceme40.dll

 

 

 

What exactly this error means?

When a managed assembly (In our case, System.Data.SqlServerCe.dll) is trying to P/Invoke a method on to a native DLL (In our case, sqlcemeNN.dll; where NN stands for version of product 30, 35 …etc), system has failed to find the DLL to load and invoke the method.

 

When do we get this error?

We get this error when system cannot find the DLL in the system path, or current process executable path.

 

How can one land in this error?  What are the probable workarounds or fixes?

There are multiple cases and some of the well known ones are given below:

1)      Prior to .NET CF 2.0 SP2, there is no concept of GAC on storage card.  And, if you have installed SQL CE Cab on storage card with .NET CF 2.0 RTM/SP1 on device, our native DLLs end up on storage card and the GAC on the main memory.   Hence, managed assembly will fail when P/Invoking above method

a.       Please use .NET CF SP2 and above

b.      Please install the cabs on main memory

c.       Please move to SQL CE 3.0 SP2/3.1 and above

 

2)      You are developing the application for smart devices (Windows CE OS based) and using Visual Studio Auto Deployment (F5) feature.  And, VS has failed to map the System.Data.SqlServerCe.dll to the right set of cabs to install and just deployed the System.Data.SqlServerCe.dll alone (Note: No error is thrown).  In this case, the native DLLs are not deployed.

a.       Fix the auto-deployment issues (Don’t ask me how L)

b.       Remove and add the reference to System.Data.SqlServerCe.  This is because, VS IDE stores assembly identity in the project file.  Since we have changed the assembly version in SQL CE v3.5 SP1, removing and adding updates the solution to host the right assembly version

c.

     

     

Manually copy and install the SQL CE Cabs (all the 3 cabs).  They are located under:

%VisualStudioInstallRoot%\SmartDevices\SDK\SQL Server\Mobile\v3.0\<platform>\<processor>

OR

%ProgramFiles%\Microsoft SQL Server Compact Edition\<version>\Devices\<platform>\<processor>

3)   System has failed to load the sqlcemeNN.dll.  To find more details on why system might have failed to load a module is discussed in previous blog post.

4)   If your machine is a 64-bit box, you might have been got trapped into default target platform 'Any CPU' trap, please set the target platform as 'x86'.  Need more details, please visit ErikEJ's blog post.

5)

    

    

In all other cases, please move to SQL CE 3.0 SP2/3.1 and above.  If possible make sure HKLM\Software\Microsoft\Microsoft SQL Server Compact Edition\<Version>\NativeDir registry points to the directory where our native DLLs are installed.  Please consider the WoW registry if running in WoW mode.

1
5
分享到:
评论

相关推荐

    P/Invoke Interop 助手

    P/Invoke Interop Assistant,它支持托管代码和非托管代码之间的方法签名的转换,而且直接生成相关的C#或者是VB的方法调用代码。这个签名的转换,不只是适用于Windows的方法签名,只要给定一个C头文件,就可以转换...

    Invoke-WCMDump结合powershell进行密码获取

    Ivoke-WCMDump 什么是Credential Manager ...从Credential Manager导出Windows凭据的Powershell脚本 https://github.com/peewpw/Invoke-WCMDump PS&gt;Import-Module .\Invoke-WCMDump.ps1 ...Invoke-WCMDump

    P/Invoke Interop Assistant交互助手

    可以把C/C++中的数据类型、结构体数据格式转换为C#或者VB版本中的对应格式类型。很方便

    精通.NET互操作 P/Invoke,C++Interop和COM Interop 【带书签目录】

    《精通.NET互操作P/Invoke,C++Interop和COM Interop》介绍Windows平台上的托管代码与非托管代码之间进行互操作的各种技术,包括由.NET提供的各种互操作方法、属性以及各种工具的用法及其工作原理。《精通.NET互操作...

    《CLR via C#》非托管代码互操作性提到的P/Invoke Interop Assistant

    《CLR via C#》非托管代码互操作性提到的P/Invoke Interop Assistant开发工具,包含源代码,是从网站:http://clrinterop.codeplex.com/ 上下载的,作为备份

    C#串口操作小例子,P/Invoke

    C#串口操作小例子,P/Invoke 调用...........

    P/Invoke Interop Assistant

    P/Invoke Interop Assistant,用来调试C++写的动态库转换成C#或VB.NET

    《精通.NET互操作:p/invoke, c++ interop和COM interop》源代码

    《精通.NET互操作:p/invoke, c++ interop和COM interop》一书的源代码

    微信JS-SDK接口JS文件 jweixin-1.4.0.js

    步骤一:引入JS文件 ... 备注:支持使用 AMD/CMD 标准模块加载方法加载 步骤二:通过config接口注入权限验证配置 所有需要使用JS-SDK的页面必须先注入配置信息,否则将无法调用(同一个url仅需调用一次,对于变化url...

    jboss-exp.rar

    java -jar jboss_exploit_fat.jar -P http://127.0.0.1:8080 -i http://192.168.7.84:10081/invoker/JMXInvokerServlet invoke jboss.admin:service=DeploymentFileRepository remove myname index .jsp

    jboss_exploit_fat

    java -jar jboss_exploit_fat.jar -P http://127.0.0.1:8080 -i http://192.168.7.84:10081/invoker/JMXInvokerServlet invoke jboss.admin:service=DeploymentFileRepository remove myname index .jsp

    jboss xml漏洞exp

    java -jar jboss_exploit_fat.jar -P http://127.0.0.1:8080 -i http://192.168.7.84:10081/invoker/JMXInvokerServlet invoke jboss.admin:service=DeploymentFileRepository remove myname index .jsp

    基于Java的微信机器人项目.zip

    哈哈哈哈&receiverNickname=Blanke&atWechatIds=&isGroup=false&receiverWxId= https://sekiro.virjar.com/invoke?group=wx_robot&action=sendMessage&content=叼毛&receiverNickname=&atWechatIds=notify@all&is...

    P/Invoke获取CultureInfo

    利用P/Invoke获取更改后的系统CultureInfo

    JNI介绍及开发i教程.rar

    JNA的功能和P/Invoke类似,但编写方法与P/Invoke截然不同。JNA没有使用Annotation, 而是通过编写一般的Java代码来实现。 P/Invoke是.NET平台的机制。而JNA是Java平台上的一个开源类库,和其他类库没有什么区别

    JNI--java调用不同平台的动态链接库,dll,so,完美,全教程

    JNA 把对 dll/.so 共享库的调用减少到了和 P/Invoke 相同的程度。 使用 JNA ,不需要再编写适配用的 .dll/.so ,只需要在 Java 中编写一个接口和一些代码,作为 .dll/.so 的代理,就可以在 Java 程序中调用 dll/so...

    使用P/Invoke来开发用于与串行设备通讯的.NET基类

    在.NET环境下编写与RS252串口通信的应用程序的唯一方法,就是引用过时了的并且有点限制的MSComm ActiveX控件。这篇文章介绍了用C#安全代码编写一个多线程的,且时尚的与RS232通讯的基础类库。这个类库使用平台调用...

    InvokeDll.rar_c#调用VC DLL

    VC++调用DLL的演示示例代码,供测试调用的CommonDll.dll已经放在测试源码的根目录下,你下载源码后可运行InvokeDll.dsw编译项目源码,将编译生成在Bin目录中的InvokeDll.exe拷贝至根目录下,双击运行,可看到程序...

    C#串口编程的几种实现方法

     第二:微软在.NET新推出了一个串口控件,基于.NET的P/Invoke调用方法实现,详细的大家可以访问微软网站http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/default.aspx,方便得到更多资料。...

Global site tag (gtag.js) - Google Analytics