Code
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="show_sql">true</property>
<property name="connection.connection_string"> Server=.;initial catalog=NH_DateBase; user=sa;password=sa;</property>
<property name="adonet.batch_size">500</property>
<property name="generate_statistics">true</property>
<property name="use_outer_join">true</property>
<property name="command_timeout">60</property>
<mapping assembly="NH.Model"/><!--*****这个地方一定要加*****-->
</session-factory>
</hibernate-configuration>
</configuration> 若果采用App.config配置,则必须加<mapping assembly="NH.Model"/>来映射你的实体层。