我有一個奇怪的問題。我有許多利用Nhibernate 2.1的C#應用程序。 在最後2天,我開始收到以下錯誤:NHibernate 2.1應用程序尋找3.0參考?
Could not load file or assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral,
PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's
manifest definition does not match the assembly reference. (Exception from HRESULT:
0x80131040)
我不能爲我的生活找到此問題的原因,我沒有更新我的引用程序和正確的V2.1 .dll是他們應該在的地方。我已經徹底清除了解決方案並重新編譯了,並且我確信它不是映射問題,因爲已知工作對象現在無法檢索。不管下面是我的對象和映射。
using System;
using System.IO;
using System.Collections.Generic;
namespace Epn.Assembly.Domain
{
public class Email
{
public int EmailId { get; set; }
public string Sender { get; set; }
public string Recipient { get; set; }
public string CC { get; set; }
public string BCC { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
public string EmailType { get; set; }
public Nullable<DateTime> SentDateTime { get; set; }
public string ErrorMessage { get; set; }
public DateTime QueueDateTime { get; set; }
public DateTime LastActivityDateTime { get; set; }
public bool HoldForReview { get; set; }
}
}
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" schema="SystemStatusDb.dbo" auto-import="true" assembly="EpnDomain" namespace="Epn.Assembly.Domain">
<class name="Epn.Assembly.Domain.Email, EpnDomain" lazy="false" table="EpnEmails">
<id name="EmailId" column="EmailId">
<generator class="native" />
</id>
<property name="Sender" column="Sender"/>
<property name="Recipient" column="Recipient" />
<property name="CC" column="CC" />
<property name="BCC" column="BCC" />
<property name="Subject" column="Subject" />
<property name="Body" column="Body" />
<property name="EmailType" column="EmailType" />
<property name="SentDateTime" column="SentDateTime" />
<property name="ErrorMessage" column="ErrorMessage" />
<property name="QueueDateTime" column="QueueDateTime" />
<property name="LastActivityDateTime" column="LastActivityDateTime" />
<property name="HoldForReview" column="HoldForReview" />
</class>
</hibernate-mapping>
你最近2天改變了什麼? – Paco 2010-08-10 19:17:52
你有沒有機會添加一個引用NHibernate 3.x的新程序集?在NHContrib或UNHAddins中說一些更新的版本? – DanP 2010-08-10 19:39:37
沒有什麼NHibernate相關的在這個應用程序中已經改變,除了上面顯示的映射和對象的添加。 – alan 2010-08-10 20:10:20