運行時黃頁顯示下邊的異常,項目中找了半天沒出現過這個列的關鍵字。sql
[ArgumentException: 列「ReservedWord」不屬於表 ReservedWords。] System.Data.DataRow.GetDataColumn(String columnName) +5310119 System.Data.DataRow.get_Item(String columnName) +13 NHibernate.Dialect.Schema.AbstractDataBaseSchema.GetReservedWords() +170 NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(Dialect dialect, IConnectionHelper connectionHelper) +100 NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(ISessionFactory sessionFactory) +78 NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners) +700 NHibernate.Cfg.Configuration.BuildSessionFactory() +104 FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:\work\coding\fluentNhibernate\src\FluentNHibernate\Cfg\FluentConfiguration.cs:230 [FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.]
百度到下邊的相似問題:session
error1. Could not create the driver from NHibernate.Driver.MySqlDataDriverapp
Configuration.DefaultNameOrConnectionString = ConfigurationManager.ConnectionStrings["Default"].ConnectionString; Configuration.Modules.AbpNHibernate().FluentConfiguration .Database(MySQLConfiguration.Standard.ConnectionString(Configuration.DefaultNameOrConnectionString)) .Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly())); .ExposeConfiguration(c => c.Properties.Add("hbm2ddl.keywords", "none"));
問題解決,主要對NHibernate和FluentNHibernate都不太熟悉,記錄一下。ui