gpt4 book ai didi

unit-testing - FluentNhibernate 和 SQLite

转载 作者:IT王子 更新时间:2023-10-29 06:27:10 27 4
gpt4 key购买 nike

我无法让 SQLite 驱动程序在我的 session 工厂中工作。

我从 http://sqlite.phxsoftware.com/ 下载了 SQLite 1.0.48

我在我的测试项目中添加了对 System.Data.SQLite 的引用。

public static IPersistenceConfigurer GetSqlLiteConfigurer()
{
try
{
return SQLiteConfiguration
.Standard
.InMemory();
}
catch (Exception ex)
{
throw ex;
}
}

这就是我生成配置器的方式

问题是当我构建 session 工厂时出现以下错误:

NHibernate.HibernateException: The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found. Ensure that the assembly System.Data.SQLite is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.
at NHibernate.Driver.ReflectionBasedDriver..ctor(String driverAssemblyName, String connectionTypeName, String commandTypeName)
at NHibernate.Driver.SQLite20Driver..ctor()

我尝试更改 SQLite 版本但没有解决问题。

我找不到问题所在,我已经为此工作了 2 天。

如果您需要更多信息,请告诉我。

感谢您的帮助!

查尔斯

最佳答案

当我遇到这个问题时,它是由我的应用程序的处理器属性设置为 anycpu 并在 64 位系统上运行引起的。为更正此问题,我将我的应用程序处理器属性设置为 x86。我认为 System.Data.SQLite.dll 不支持在 x64 进程下运行。

关于unit-testing - FluentNhibernate 和 SQLite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/845490/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com