SQLite を使用する Outlook アドインを開発しています。Outlook が例外をスローしています。アセンブリをバインドできません。Fusion ログを有効にすると、次のログからわかるように、「マネージド アセンブリ」が正常に読み込まれていることがわかりました。
*** 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 つで発生しています。私のマシンでは、リリース ビルド後も問題なく動作しています。
それでも、例外の後でも、アドインは正常に機能します。
よろしく モヒット・タクラル