这是我的休眠设置:
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" 上运行。