我用的是NHibernate的3.3.3版本 web.config中如何配置  还有对应的xml的NHibernate 版本如何写??下面是我的配置方式web.comfig中
 <configSections>
    <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
xml中<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-3.3.3">
  <class name="mvcweb.Models.Course, mvcweb.Models" table="Course">
    <id name="CourseId" column="CourseId" type="Int32">
      <generator class="native" />
    </id>
    <property name="CourseName" column= "CourseName" type="string" length="40"/>
    <property name="DateCreated"  type="DateTime" length="8"/>
  </class>
</hibernate-mapping>程序运行时 在读取xml是 提示 Could not compile the mapping document: G:\project\MVCTest\web\mvcweb\mvcweb\Content\xml\Course.hbm.xml这个 异常NHibernate

解决方案 »

  1.   

    <nhibernate>
        <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
        <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect"/>
        <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
       
        <add key="hibernate.connection.connection_string" value="这里填写你数据库链接字符串"/>
       
      </nhibernate>
    上面“这里填写你数据库链接字符串”会写吧。
    填写完再试试。