Joh*_*ith 8 c# sqlite mono dllnotfoundexception
我最近一直想弄明白这一点.它正在我的Windows机器上工作,我从NuGet获得了SQLite,但......
当我把System.Data.SQLite.dll和SQLite.Interop.dll直接从我的Windows机器到Linux服务器,它说的是SQLite.Interop.dll没有找到,但我相信我看到它旁边的可执行的权利.
然后我试图编译System.Data.SQLite.dll使用/p:UseInteropDll=false,但没有运气.这次它说System.Data.SQLite.dll找不到.
这个"未被发现"的谜团是什么?
use*_*372 10
无需更改代码.你可以自己构建它.
apt-get install build-essentials unzipunzip而且cd Source,chmod +x在compile-interop-assembly-release.sh构建shell脚本,然后运行它./compile-interop-assembly-release.sh.- 它将.so在../bin目录中构建一个文件..so文件复制到您的应用程序所在的目录中Mono.Data.SQLite.dll在Linux上使用.看看Mono手册在Linux上使用SQLite或在Mono 上构建System.Data.SQLite.dll.
你也可以映射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>
Run Code Online (Sandbox Code Playgroud)
我在Windows中开始开发,但随后将应用程序移动到Mono(Ubuntu 14),这是SQLite提供程序无法按OP描述加载的地方.
我不得不使用以下命令重新编译System.Data.SQLite.dll:
MSBuild System.Data.SQLite.2012.csproj /t:Rebuild /p:UseInteropDll=false /p:UseSqliteStandard=true
Run Code Online (Sandbox Code Playgroud)
但是,在此之后我得到以下异常:
提供程序未返回ProviderManifest实例.方法
System.Data.SQLite.UnsafeNativeMethods:GetSettingValue (string,string)' is inaccessible from methodSystem.Data.SQLite.EF6.SQLiteProviderManifest:GetProviderManifestToken(string)'
要解决这个问题,我不得不使用以下命令重新编译System.Data.SQLite.EF6.dll:
MSBuild System.Data.SQLite.EF6.2012.csproj /t:Rebuild /p:UseInteropDll=false /p:UseSqliteStandard=true
Run Code Online (Sandbox Code Playgroud)
将所有生成的文件复制到Mono项目的bin目录后,一切正常.
我使用的SQLite提供程序源代码版本是1.0.98.1.
希望这能节省很多时间......
| 归档时间: |
|
| 查看次数: |
8888 次 |
| 最近记录: |