定期我得到以下异常:

无法加载DLL 'SQLite.Interop.dll':无法找到指定的模块。(异常来自HRESULT: 0x8007007E)

我使用的是1.0.82.0。在VS2010, Win7 64操作系统下使用nuget安装。

一旦异常开始出现,它就会不断出现——在调试和发布中,在VS内部或外部运行应用程序。

阻止它的唯一方法就是退出并重新登录。不抛出异常并加载dll。 它可以工作几天,但之后又会坏掉。

有人见过这样的情况吗,有解决方案吗?


当前回答

我不知道这是否是一个好的答案,但我能够通过在AppDomain下以“本地系统”的身份运行我的应用程序来解决这个问题。

其他回答

对于任何关注这个问题的人来说:

如果您使用nuget包,它会安装一个构建规则,为您执行复制。(参见System.Data.SQLite.Core.1.0.94.0\build -或任何你安装的Core版本)。

nuget安装程序会自动将规则添加到项目文件中。

但是,这仍然不能解决测试用例问题。deploymenttem (https://stackoverflow.com/a/24411049/89584)方法似乎是惟一可行的方法。

如果您试图在64位项目中运行32位dll,也可能会出现此错误。

当我在x86和x64文件夹中放置相同的文件(32位版本的SQLite.Interop.dll)时,我得到了这个。

将x86和x64的“SQLite.Interop.dll”文件复制到调试文件夹中。这些文件应该复制到调试文件夹中的“x86”和“x64”文件夹中。

I got the same problem. However, finally, I can fix it. Currently, I use Visual Studio 2013 Community Edition. I just use Add->Existing Item... and browse to where the SQLite.Data.SQLite files are in (my case is 'C:\Program Files (x86)\System.Data.SQLite\2013\bin'). Please don't forget to change type of what you will include to Assembly Files (*.dll; *.pdb). Choose 'SQLite.Interop.dll' in that folder. From there and then, I can continue without any problems at all. Good luck to you all. ^_^ P.S. I create web form application. I haven't tried in window form application or others yet.

我有这个问题,因为Visual c++ 2010可重分发没有安装在我的电脑。如果你还没有安装Visual c++ 2010 redistributable,下载并安装这个(检查x86或64 dll)。