问题描述
我最近一直在尝试解决这个问题.它正在我的 Windows 机器上运行,我从 NuGet 获得了 SQLite,但是......
I've been trying to figure this out lately. It is working on my Windows machine, where I got SQLite from NuGet, but...
当我将 System.Data.SQLite.dll
和 SQLite.Interop.dll
从我的 Windows 机器直接放入 Linux 服务器时,它说 SQLite.Interop.dll
未找到,但我确信我在可执行文件旁边看到它.
When I put System.Data.SQLite.dll
and SQLite.Interop.dll
straight from my Windows machine into Linux server it says that SQLite.Interop.dll
is not found, but I am sure I see it next right to executable.
然后我尝试用 /p:UseInteropDll=false
编译 System.Data.SQLite.dll
,但没有成功.这次它说 System.Data.SQLite.dll
没有找到.
Then I tried to compile System.Data.SQLite.dll
with /p:UseInteropDll=false
, but with no luck. This time it says that System.Data.SQLite.dll
is not found.
这个未发现"的谜团是什么?
What is this "not found" mystery?
推荐答案
在 Linux 上使用 Mono.Data.SQLite.dll
.查看 Mono 手册以在 Linux 上使用 SQLite 或 在 Mono 上构建 System.Data.SQLite.dll.
Use Mono.Data.SQLite.dll
on Linux. Take a look at the Mono manual to using SQLite on Linux or build the System.Data.SQLite.dll on Mono.
你也可以映射DLL:
<configuration>
<dllmap dll="sqlite" target="libsqlite.so.0" os="linux"/>
<dllmap dll="sqlite" target="libsqlite.0.dylib" os="osx"/>
<dllmap dll="sqlite3" target="libsqlite3.so.0" os="linux"/>
<dllmap dll="sqlite3" target="libsqlite3.0.dylib" os="osx"/>
</configuration>
这篇关于Mono SQLite 上的 System.DllNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!