2011-08-09 20 views
3

我試着流利NHibernate 2.12與System.Data.SQLite(版本1.0.74.0與.NET4 x64)。
當試圖創建我的會話工廠,我得到以下錯誤(最裏面的除外):System.Data.SQLite和流利NHibernate的 - IDBCommand找不到

在裝配 System.Data.SQLite的IDbCommand和執行的IDbConnection找不到。確保程序集 System.Data.SQLite位於應用程序目錄或 全局程序集緩存中。如果程序集位於GAC中,則在應用程序配置文件中使用 元素至 指定程序集的全名。

試了一下已經提出 我的app.config看起來是這樣的:

<configuration> 
    <startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 
    </startup> 
    <runtime>  
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" > 
     <probing privatePath="Lib\NHibernate;Lib\Castle;Lib\SQLite"></probing> 
     <qualifyAssembly 
     partialName="System.Data.SQLite" 
     fullName="System.Data.SQLite, Version=1.0.74.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> 
    </assemblyBinding> 
    </runtime> 
</configuration> 

和我的私人探測路徑中包含(已經檢查過)
有人有線索了正確的文件?

+0

你在你的項目中引用SQLLite DLL錯誤的參考? – csano

+1

你可以看看.net程序集解析日誌與Fuslogvw.exe?在那裏你可以看到他在哪裏搜索sqllite,以及是否有加載它的問題 – Firo

回答

0

我剛剛爲SQLite單元測試設置了流利的nhibernate,所以這裏有一些我可以給你的提示。 如果您使用Visual Studio 2010進行調試,您將需要悲哀地使用SQLite 32位。當您嘗試包含64位程序集時,應該在Visual Studio的下一個版本中包含已知的錯誤。 除此之外,我建議你確保你已經在你的網頁配置中包含以下條目。

<configuration> 
    <startup useLegacyV2RuntimeActivationPolicy="true"> 
     <supportedRuntime version="v4.0"/> 
    </startup> 
</configuration> 

PS發現 http://connect.microsoft.com/VisualStudio/feedback/details/556670/could-not-load-file-or-assembly-error-when-referencing-a-64-bit-assembly