0
我有一個NHibernate的配置文件,如下所示:功能NHibernate映射異常的編纂映射文檔
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="MyProject">
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string_name">MyProject</property>
<property name="connection.isolation">ReadCommitted</property>
<property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache</property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
</session-factory>
</hibernate-configuration>
在創建配置對象:
Configuration cfg = new Configuration();
cfg.AddFile(nhibernateConfigurationFile);
努力時,我收到以下錯誤運行持久性測試:
System.InvalidOperationException:Could not發現在配置方言
NHibernate.MappingException:無法編譯映射文件:C:\ PathToProject \ BIN \調試\ NHibernateMyProject.config
任何人都知道爲什麼它有麻煩閱讀nhibernate配置文件?從什麼我能看到,方言肯定是在配置....