【发布时间】:2025-12-07 20:25:01
【问题描述】:
这是我的休眠设置:
FluentConfiguration configuration = Fluently.Configure()
.Database(PostgreSQLConfiguration.Standard.ConnectionString(c => c
.Host("localhost")
.Port(5432)
.Database("PEDAux")
.Username("ped_admin")
.Password("xxxxx"))
.ShowSql)
.Mappings(m => m.FluentMappings
.AddFromAssembly(Assembly.GetExecutingAssembly())
.Conventions.Add<TableNameConvention>()
.Conventions.Add<ColumnNameConvention>()
)
.ExposeConfiguration(x =>
{
// TODO: Not yet sure what to put in here
});
return configuration.BuildSessionFactory();
我收到以下错误:
内部异常 1: HibernateException:无法从 NHibernate.Driver.NpgsqlDriver 创建驱动程序,NHibernate,Version=5.2.0.0,Culture=neutral,PublicKeyToken=aa95f207798dfdb4。
内部异常 2: TargetInvocationException: 调用目标抛出异常。
内部异常 3: ArgumentException:找不到请求的 .Net Framework 数据提供程序。可能没有安装。
当我使用 SQLServer 时,相同的配置集似乎可以工作。当然,对于 SQL Server,我使用的是 SQLServer 配置对象。 项目在 .NET Version=v4.7.2" 上运行。
【问题讨论】: