2012-10-10 33 views
1

我想在MonoMac程序中使用SQLite數據庫(意圖在MonoTouch應用程序中重用數據庫)。在MonoMac項目中找不到System.Data.SQLite

我試過兩種不同的ORM,並且都出現了同樣的問題。在網上搜索,我發現了MONO_LOG_LEVEL=debug標誌和很多信息,但我無法完成它的工作。

目前,我引用Mono.Data.SQLite,但從我發現的,似乎這只是一個系統特定版本的包裝。

這裏的誤差輸出:

黑白:加載組件System.Data V2.0.0.0請求被重新映射到V4.0.0.0 單聲道:裝配裝載機探測位置:「/庫/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Data/4.0.0.0_ b77a5c561934e089/System.Data.dll'。 單聲道:Image addref System.Data [0x62ada0] - > /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Data/4.0.0.0 _b77a5c561934e089/System.Data.dll [單位:組裝System.Data [0x62ada0]添加到域SQLTest.exe,ref_count = 1 單聲道:AOT未能加載AOT模塊/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/ mono/gac/System.Data/4.0.0.0_ b77a5c561934e089/System.Data.dll.dylib:dlopen(/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Data/ 4.0.0.0 _b77a5c561934e089/System.Data.dll.dylib,9):圖像沒有發現

單聲道:裝配裝載機從位置加載的組件:「/Library/Frameworks/Mono.framework/Versions/2.10.9/lib /mono/gac/System.D ata/4.0.0.0_ b77a5c561934e089/System.Data.dll'。 單聲道:配置嘗試解析:'/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Data/4.0.0.0 _b77a5c561934e089/System.Data.dll.config'。 單聲道:配置試圖解析:'/Library/Frameworks/Mono.framework/Versions/2.10.9/etc/mono/assemblies/System.Data/System.Data.config'。 單位:裝配參考addref Catnap [0x6213c0] - > System.Data [0x62ada0]:2 單位:裝配參考addref System.Data [0x62ada0] - > mscorlib [0x1001d90]:6 單位:裝配裝載機探測位置:'/圖書館/框架/ Mono.framework /版本/ 2.10.9/lib目錄/ System.Data.SQLite.dll」。 單聲道:程序集加載程序探測位置:'/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/System.Data.SQLite.exe'。

未處理的異常:System.IO.FileNotFoundException:無法加載文件或程序集「System.Data.SQLite」或其某個依賴項。該系統找不到指定的文件。 文件名:'System.Data.SQLite' at System.AppDomain.Load(System.String assemblyString,System.Security.Policy.Evidence assemblySecurity,Boolean refonly)[0x00000] in:0 at System.AppDomain.Load( System.AppDomain:Load(string) at System.Reflection.Assembly.Load(System.String assemblyString)[0x00000] in(System.String assemblyString)[0x00000] in:0 at(wrapper remoting-invoke-with-check) :0 at Catnap.Database.BaseDbAdapter.ResolveConnectionType(System.String connectionTypeAssemblyName)[0x00000] in:0 at Catnap.Database.Sqlite.BaseSqliteAdapter..ctor(System.String connectionTypeAssemblyName)[0x00000] in:0 at Catnap .Database.Sqlite.SqliteAdapter..ctor()[0x00000]:0 at Catnap.DbAdapter。在SQLTest.MainClass.Main(系統)中,在YAData.Connection.Connect()[0x00000]處:0 中的get_Sqlite()[0x00000]字串[] args)[0x00000]中:0

我已經嘗試添加一個配置文件與

<configuration> 
    <dllmap dll="sqlite3" target="/usr/local/lib/libsqlite3.0.dylib" os="!windows"/> 
</configuration> 

到應用程序,我嘗試了修改/Library/Frameworks/Mono.framework/Versions/2.10.9/etc/mono/config,但沒有奏效。它仍然在錯誤的地方看,而不是找到SQLite。

請幫忙嗎?

回答

0

我仍然不知道爲什麼它正在尋找System.Data.SQLite,但我自己重新編譯了一個ORM,而不是使用提供的DLL,它工作。我相信一些問題是我在MonoMac項目中使用MonoTouch DLL。重新編譯CoolStorage(使用Mono.Data.Sqlite而不是System.Data.SQLite)解決了它。

如果有人能給我一個解釋,我會切換接受的答案。

關於代碼!