我会定期收到以下异常:
Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
我使用的是1.0.82.0。版本,使用nuget在VS2010,OS Win7 64中安装它。
一旦异常开始出现,它就会不断出现-在调试和发布中,以及在VS内部或外部运行应用程序。
阻止它的唯一方法是注销并登录。不会引发异常,而是加载dll。它可以工作几天,但它可能会再次崩溃。
有没有人见过这样的东西,有解决方案吗?
发布于 2018-03-01 05:54:52
因此,在添加NuGet之后,部署不会向下复制互操作。您可以将此代码添加到您的csproj文件中,它应该会修复该行为:
<PropertyGroup>
<ContentSQLiteInteropFiles>true</ContentSQLiteInteropFiles>
<CopySQLiteInteropFiles>false</CopySQLiteInteropFiles>
<CleanSQLiteInteropFiles>false</CleanSQLiteInteropFiles>
<CollectSQLiteInteropFiles>false</CollectSQLiteInteropFiles>
</PropertyGroup>
如果你查看SQLite的NuGet源代码,你会发现它们具体在做什么。这使我能够使用ASP.Net核心进行部署。
发布于 2015-01-22 23:26:42
我遇到这个问题是因为我使用的dll将Sqlite作为依赖项(在NuGet中仅使用Sqlite核心包进行配置)。该项目编译并复制除'SQLite.Interop.dll‘( x86和x64文件夹)之外的所有Sqlite dll-s。
解决方案非常简单:只需将System.Data.SQLite.Core包作为依赖项(使用NuGet)添加到您正在构建/运行的项目中,dll-s就会被复制。
发布于 2013-09-26 07:52:03
这就是我如何在我的项目中修复它。
它正在工作,当一位同事提交他的更改时,我收到了"Unable to load DLL 'SQLite.Interop.dll'“异常。
与项目的.csproj文件不同,这是一个非工作版本:
<ItemGroup>
<Content Include="x64\SQLite.Interop.dll" />
<Content Include="x86\SQLite.Interop.dll" />
</ItemGroup>
这就是工作版本所具有的:
<ItemGroup>
<Content Include="x64\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="x86\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
恢复后,我没有收到异常。DLL文件已转储到相应的Debug\x64 (etc)文件夹中。
https://stackoverflow.com/questions/13028069
复制相似问题