【发布时间】:2023-04-06 14:11:01
【问题描述】:
我需要在 win7 上的 VS2013 中为我的应用程序 (x64) C# 访问 SQLite3.dll。
从 SQLite: sqlite3.dll vs System.Data.SQLite.dll?
我看到了
"The sqlite3.dll is unmanaged code containing the databae engine itself and it is embedded as resource inside the managed System.Data.SQLite assembly. "
所以,我从包管理器安装了 System.Data.SQLite.x64:
PM> Install-Package System.Data.SQLite.x64
Attempting to resolve dependency 'System.Data.SQLite.Linq (≥ 1.0.99.0)'.
Attempting to resolve dependency 'System.Data.SQLite.EF6 (≥ 1.0.99.0)'.
Attempting to resolve dependency 'EntityFramework (≥ 6.0.0.0)'.
'System.Data.SQLite.x64 1.0.99.0' already installed.
My_project already has a reference to 'System.Data.SQLite.x64 1.0.99.0'.
我在 VS2013 中添加了它作为参考。 但是,我得到了错误:
An unhandled exception of type 'System.DllNotFoundException' occurred in Devart.Data.SQLite.dll
Additional information: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
然后,我从 http://www.sqlite.org/download.html
我将 Sqlite3.dll 和 Sqlite3.def 放在 bin/Debug 中,并将其添加为内容文件,并将其“复制到输出”属性更改为“始终复制”,但出现错误。
An unhandled exception of type 'Devart.Data.SQLite.SQLiteException' occurred in Devart.Data.SQLite.dll
Additional information: Assembly that contains embedded dotConnect for SQLite license cannot be used with this application: my_app.exe
然后,我下载了 Sqlite3.dll (x86) 并做了与 x64 相同的事情。得到同样的错误:
Additional information: Assembly that contains embedded dotConnect for SQLite license cannot be used with this application: my_app.exe.
链接也无济于事, Could not load file or assembly 'System.Data.SQLite'
有什么建议吗?谢谢。
【问题讨论】:
-
写得很好的问题 - 欢迎来到 SO :)
-
问题不在于 SQLite。问题似乎是一个叫做
Devart dotConnect的东西,检测到你有 SQLite,但它似乎需要某种特殊许可证。 -
需要什么样的许可证?如何得到它?谢谢
标签: c# visual-studio sqlite