Lin*_*ane 8 .net sqlite-net apple-m1 .net-6.0
我在 M1 Pro 上使用 dotnet 6,并且正在努力使用 SQLite-Package。
System.DllNotFoundException: Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies.
这是每当我尝试运行该应用程序时引发的错误。然而建筑工作正常。
我通过在我的 M1 macbook 上从源代码构建 Interop.dll 文件和 dotnet 库文件来解决这个问题。仅构建 Interop.dll 会导致 EntrypointNotFoundException。要构建该库,请从SQLite 网站下载源代码,在撰写本文时,这就是该文件sqlite-netFx-source-1.0.115.5.zip。提取它并运行该文件Setup/compile-interop-assembly-release.sh。要构建库,请dotnet build -c Release在System.Data.SQLite目录中运行。您的互操作文件将位于bin/2013/Release/bin. 我将其符号链接到/usr/local/lib/libSQLite.Interop.dll,但您也可以将其复制到项目目录中作为libSQLite.Interop.dll. 现在将引用添加到bin/NetStandard21/ReleaseNetStandard21/bin/netstandard2.1/System.Data.SQLite.dll您的项目中,它应该可以正常运行。
1.0.115更新:在撰写本文时,使用直接来自 NuGet 的过时版本也可以正常运行。
作为尚未针对 arm64 的 sqlite的解决方法,您可以使用 .net 6 x64 架构。
CMD ,打开首选项/usr/local/share/dotnet/x64/dotnet| 归档时间: |
|
| 查看次数: |
2841 次 |
| 最近记录: |