有時我真的開始想知道我的源代碼中發生了什麼: 我試圖使用npgsql 2.0.11.0連接到PostGres 9.0,我確信我已經做了,但現在,我的計劃將引發NotSupportedException異常,因爲它步入了以下內容:C#/ Postgres/FluentNHibernate:配置npgsql拋出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();
堆棧跟蹤是很整齊看:只有一條線路。
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();
不過,結果是一樣的。任何人有類似的問題或 - 更好 - 修復?