.net nhibernate问题

来源:百度知道 编辑:UC知道 时间:2024/05/11 23:59:44
错误 1 TestCase 'M:hibernate.TEST.NHibernateSampleFixture.TestFixtureSetup'
failed: The hibernate.connection.driver_class must be specified in the NHibernate configuration section.

用TESTDRIVEN测试的

这个错误提示应该是在NHibernate的配置节点中缺少了hibernate.connection.driver_class的配置内容或是NHibernate的整个配置项没有给正确的标签,好好检查下自己的App.config或是自己的Web.config中的配置了。
给你一个在项目中的配置例子
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate"/>
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="dialect">
NHibernate.Dialect.Oracle9Dialect
</property>
<property name="connection.driver_class">
NHibernate.Driver.OracleClientDriver
</property>
<property name="connection.connection_string">
Data Source=aaaaa;User Id=aaaa;Password=aaa
</property>
<property name=&q