我在执行
      ISessionFactory factory = null;
      Configuration cfg = null;
      cfg = new Configuration();
      cfg.AddAssembly("business");
      factory = cfg.BuildSessionFactory();

     cfg.AddAssembly("business");报错。
报错内容是:could not interpret type: Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate 
映射文件内容为
using System;
using Nullables; 
namespace business.Entity
{
/// <summary>
/// Person 的摘要说明。
/// </summary>
public class Person
{ int _id;
string _name;
Nullables.NullableDateTime _dateOfBirth;
public Person()
{
}
public int Id
{
get { return this._id; }
}
public string Name
{
get { return this._name; }
set { this._name = value; }
}
public Nullables.NullableDateTime DateOfBirth
{
get { return this._dateOfBirth; }
set { this._dateOfBirth = value; }
} }
}<?xml version="1.0" encoding="utf-8" ?> 
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
    <class name="business.Entity.Person, business" table="Person">
        <id name="Id" access="field.camelcase-underscore" unsaved-value="0">
            <generator class="native" />
        </id>
        <property name="Name" type="String" length="200" />
        <property name="DateOfBirth" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" column="DateOfBirth"/>
    </class>
</hibernate-mapping>我已经加载了Nullables.dll 和 Nullables.NHibernate请各位高手看看怎么回事

解决方案 »

  1.   

    你的NHibernateContrib是不是最新版的?
      

  2.   

    是的,我是1.0.0.2的那个Nullables.NHibernate.dll也是配套的
      

  3.   

    用的NHibernate.DLL与扩展类不是一个版本
      

  4.   

    已解决了,最主要的问题是没有再最外层使用的地方的bin目录下copy进来,反射的时候找不到dll,或者直接引进来。引进来需要连同该扩展Nullables.Nhibernate.dll 所带的Nhibernate.dll一起引用进来,否则再gettype()方法中取不倒对象。建议还是将两个项目一起加入到所使用的解决方案里边一起编译。