定期我得到以下异常:

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

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

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

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

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


当前回答

这对我来说很管用。

With Visual Studio open, search and install SQLite.Core via the NUGET Package manager. Go to Solution Explorer in VS, Right click your PROJECT NAME-->ADD-->NEW FOLDER Name the folder x64 Repeat the process and add folder and name it x86 Right click the x64 folder-->ADD-->EXISTING ITEM Then browse to the DEBUG FOLDER. You will find the x64 folder. Open it and select the "SQLite.Interop.dll" file then hit OK. Repeat step 5 for the x86 folder. Right click the DLL that you just added and select PROPERTIES. In the option Copy to Output Directory, choose Copy always. Repeat step 7 for both DLLs in x64 and x86 folder.

下次构建该项目并使用另一台计算机时,它应该可以正常工作。

其他回答

我在多个项目的解决方案中遇到了类似的问题。SQLite.Interop.dll对于使用ClickOnce随软件发布的一个插件是必要的。

在visual studio中调试一切正常,但是部署的版本缺少包含DLL的文件夹x86/和x64/。

使用ClickOnce让它在部署后工作的解决方案是在解决方案的启动项目(也是正在发布的项目)中创建这两个子文件夹,将dll复制到其中,并将它们设置为Content copy Always。

通过这种方式,ClickOnce发布工具自动将这些文件和文件夹包含在清单中,并使用它们部署软件

刚刚为我做了这个:在包管理器控制台上安装-Package System.Data.SQLite.Core。

我在运行Visual Studio Express 2013时也遇到了同样的问题。我尝试了这里和其他地方提到的几种解决方案,但都没有用。我希望这个修正能帮助到其他人。

我通过在测试基于sqlite的服务的测试类上使用deploymenttem属性来修复它。

例子:

[TestClass]
[DeploymentItem(@"x86\SQLite.Interop.dll", "x86")] // this is the key
public class LocalStoreServiceTests
{

    [TestMethod]
    public void SomeTestThatWasFailing_DueToThisVeryIssue()
    {
         // ... test code here
    }
}

这将导致所需的SQLite.Interop.dll被复制到适当的“TestResults”文件夹中的x86目录。

全是绿色的。一切都很好。

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.

我在这个问题上挣扎了很长一段时间,偶尔会发现测试设置不正确。请看这张图片:

我只要取消测试设置,问题就消失了。否则会出现异常。 希望这能帮助到一些人。 不确定这是根本原因。