尝试使用F# SQLProvider与SQLite,但一直收到错误消息:
我已尝试相对路径和绝对路径(resolutionPath1和resolutionPath2),并验证了SQLite.Interop.dll实际上存在于resolutionPath2引用的目录中。
目标框架和CPU(.NET 4.6和x86)与指定目录(以\net46\x86结尾)同步。我错过了什么?
更新:
根据此问题的答案,我已更新SQLProvider SQLite文档。
更新2:
System.Data.SQLite在版本1.0.104.0中解决了此问题。请参见此讨论。
The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found.
代码:open FSharp.Data.Sql
let [<Literal>] resolutionPath1 =
__SOURCE_DIRECTORY__ + @"..\..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\x86\"
let [<Literal>] resolutionPath2 =
@"f:\proj\WanLog\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\x86"
let [<Literal>] connectionString =
"Data Source=" + @"F:\proj\WanLog\WanLog\bin\Debug\WanIPLog.s3db"
type sql = SqlDataProvider<
ConnectionString = connectionString,
DatabaseVendor = Common.DatabaseProviderTypes.SQLITE,
ResolutionPath = resolutionPath2,
IndividualsAmount = 1000,
UseOptionTypes = true >
我已尝试相对路径和绝对路径(resolutionPath1和resolutionPath2),并验证了SQLite.Interop.dll实际上存在于resolutionPath2引用的目录中。
目标框架和CPU(.NET 4.6和x86)与指定目录(以\net46\x86结尾)同步。我错过了什么?
更新:
根据此问题的答案,我已更新SQLProvider SQLite文档。
更新2:
System.Data.SQLite在版本1.0.104.0中解决了此问题。请参见此讨论。
ResolutionPath
指向一个包含System.Data.SQLite.dll
的目录,并且具有带有SQLiteInterop.dll
的x64
和x86
子目录,则也可以工作,从而允许您选择“Any CPU”目标。 - John Reynolds