2012-08-16 46 views
2

我正在開發一個使用SQLite的outlook add。 Outlook正在拋出異常無法綁定程序集。我啓用了融合日誌,並發現了「管理大會」正在加載罰款,因爲它是從下列記錄SQLite 1.0.65程序集綁定錯誤

*** Assembly Binder Log Entry (16/08/2012 @ 14:13:37) *** 

The operation was successful. 
Bind result: hr = 0x0. The operation completed successfully. 

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll 
Running under executable C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE 
--- A detailed error log follows. 

=== Pre-bind state information === 
LOG: DisplayName = System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139 
    (Fully-specified) 
    LOG: Appbase = file:///C:/Program Files/TargetIntegration/CiviSync/ 
    LOG: Initial PrivatePath = NULL 
    LOG: Dynamic Base = NULL 
    LOG: Cache Base = NULL 
    LOG: AppName = OUTLOOK.EXE 
    Calling assembly : ServiceStack.OrmLite.SqliteNET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. 
    === 
    LOG: This bind starts in default load context. 
    LOG: Using application configuration file: C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE.Config 
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. 
    LOG: Post-policy reference: System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139 
    LOG: GAC Lookup was unsuccessful. 
    LOG: Attempting download of new URL file:///C:/Program Files/TargetIntegration/CiviSync/System.Data.SQLite.DLL. 
    LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\<CompName>\CiviSync\System.Data.SQLite.dll 
    LOG: Entering download cache setup phase. 
    LOG: Assembly Name is: System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139 
    WRN: A duplicate assembly was found while copying the assembly item to the cache. 
    LOG: Binding succeeds. Returns assembly from C:\Users\<UserName>\AppData\Local\assembly\dl3\9N164N9X.7OK\DRB00MX7.CBX\2f49c891\005cc530_ea6ccd01\System.Data.SQLite.dll. 
    LOG: Assembly is loaded in default load context. 

可見,但在加載本地裝配,按以下異常被拋出異常。

*** Assembly Binder Log Entry (16/08/2012 @ 14:13:37) *** 

The operation failed. 
Bind result: hr = 0x80070002. The system cannot find the file specified. 

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll 
Running under executable C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE 
--- A detailed error log follows. 

=== Pre-bind state information === 
LOG: DisplayName = System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139 
(Fully-specified) 
LOG: Appbase = file:///C:/Program Files/TargetIntegration/CiviSync/ 
LOG: Initial PrivatePath = NULL 
LOG: Dynamic Base = NULL 
LOG: Cache Base = NULL 
LOG: AppName = OUTLOOK.EXE 
Calling assembly : ServiceStack.OrmLite.SqliteNET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. 
=== 
LOG: Start binding of native image System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139. 
WRN: No matching native image found. 
LOG: IL assembly loaded from C:\Users\<username>\AppData\Local\assembly\dl3\9N164N9X.7OK\DRB00MX7.CBX\2f49c891\005cc530_ea6ccd01\System.Data.SQLite.dll. 

我不知道爲什麼會發生這種情況。發佈版本之後,這發生在客戶機器之一上。在我的機器上,即使在發佈版本之後,它仍能正常工作。

甚至沒有,即使在例外之後,加入工作正常。

問候 莫希特德加拉

回答

1

一般最sqlite的問題是一個32位/ 64位的DLL不匹配的結果。你需要挑選最合適的SQLite庫爲您的平臺:

僅限.NET的版本是混合模式程序集,嵌入了sqlite3.dll的本機版本,而Mono/.NET版本包含外部32/64位Windows dll。如果您使用此功能,則需要將相應的sqlite3.dll複製到您的項目目錄中,並將構建操作設置爲如果是新的

您應該可以爲您的平臺使用單聲道或混合模式部件。

+0

感謝您的回覆Demis,我只使用「ServiceStack.OrmLite.Sqlite32」。 ServiceStack.OrmLite.Sqlite32.3.8.3是我正在使用的確切版本。 在nuget包中有一個「System.Data.SQLite.dll」,這個文件在lib目錄下。似乎這可能是一個問題。在文件的細節它說原始文件名爲「SQLite3.DLL 3.6.16」。 – Mohit 2012-09-28 20:15:04