有时我真的开始想知道我的源代码中发生了什么:我正在尝试使用 npgsql 2.0.11.0 连接到 PostGres 9.0,我很确定我已经这样做了,但是现在,我的程序在进入时抛出了NotSupportedException以下 :
ISessionFactory sf = Fluently.Configure()
.Database(PostgreSQLConfiguration.PostgreSQL82
.ConnectionString(c => c
.Host("localhost")
.Port(5432)
.Database("cw")
.Username("cw")
.Password("mypass")))
.Mappings(x => x.FluentMappings.AddFromAssemblyOf<MyMapping>())
.BuildSessionFactory();
Stacktrace 看起来非常整洁:只有一行。
at NHibernate.Dialect.Dialect.GetDataBaseSchema(DbConnection connection) in d:\CSharp\NH\nhibernate\src\NHibernate\Dialect\Dialect.cs:Line 718.
我尝试将其转录为以下内容:
ISessionFactory sf = Fluently.Configure()
.Database(PostgreSQLConfiguration.PostgreSQL82
.ConnectionString(c => c.Is("Server=localhost;Port=5432;Database=cw;User Id=cw;Password=myPass;")))
.Mappings(x => x.FluentMappings.AddFromAssemblyOf<CardTemplateMapping>())
.BuildSessionFactory();
不过,结果是一样的。任何人都有类似的问题,或者 - 甚至更好 - 修复?