Visual Studio2010でセットアッププロジェクトを作成する際に問題が発生しました。Addin-expressを使用してMicrosoftExcelに関連付けられたプログラムを作成し、その中でSQLiteを使用して単純なデータベースを作成しています。私はstackoverflowに関する他の回答を読みましたが、それらのソリューションは私を助けませんでした。
http://sqlite.phxsoftware.comにあるSQLite.netを使用しています。そのWebサイトに接続できなかったため、dllへの直接リンクはhttp://sourceforge.net/projects/sqlite-dotnet2/です。
このアドインは32ビットバージョンのMicrosoftOfficeExcelを使用していますが、64ビットのWindows 7を実行しているため、VisualStudio2010プロジェクトに32ビットバージョンのdllを含めました。Visual Studioのデバッグで32ビットdllを実行するのに問題はなかったので、同じdllをVisualStudioインストールプロジェクトに含めました。ただし、このインストールプログラムを仮想マシン(Windows 7 64ビット)で実行すると、次のエラーとスタックトレースが表示されます。
Detailed technical information follows:
---
(Inner Exception)
(Inner Exception)
Date and Time: 4/5/2012 7:24:52 PM
Machine Name: TOM-PC
IP Address: --------------------
Current User: Tom-PC\Tom
Application Domain: C:\Program Files (x86)\Fintools\Fintools XL\
Assembly Codebase: file:///C:/Program Files (x86)/Fintools/Fintools XL/AddinExpress.MSO.2005.DLL
Assembly Full Name: AddinExpress.MSO.2005, Version=6.5.3057.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 6.5.3057.2005
Exception Source:
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: Failed to load the runtime. (Exception from HRESULT: 0x80131700)
Exception Target Site: Object reference not set to an instance of an object.
---- Stack Trace ----
(Outer Exception)
Date and Time: 4/5/2012 7:24:52 PM
Machine Name: TOM-PC
IP Address: -------------------
Current User: Tom-PC\Tom
Application Domain: C:\Program Files (x86)\Fintools\Fintools XL\
Assembly Codebase: file:///C:/Program Files (x86)/Fintools/Fintools XL/AddinExpress.MSO.2005.DLL
Assembly Full Name: AddinExpress.MSO.2005, Version=6.5.3057.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 6.5.3057.2005
Exception Source: COMWizards
Exception Type: System.IO.FileLoadException
Exception Message: Could not load file or assembly 'System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. Failed to load the runtime. (Exception from HRESULT: 0x80131700)
Exception Target Site: GetDataTable
---- Stack Trace ----
COMWizards.SQLiteDatabase.GetDataTable(sql As String)
AddinExpress.MSO.2005.DLL: N 00000 (0x0) JIT
COMWizards.frmImpliedForwardRate.GetMostRecentDate(strDataTableName As String)
AddinExpress.MSO.2005.DLL: N 0020 (0x14) IL
COMWizards.frmImpliedForwardRate..ctor(appExcel As _Application, Path As String)
AddinExpress.MSO.2005.DLL: N 0110 (0x6E) IL
COMUI.AddinModule.adxIFRWiz_OnClick(sender As Object, control As IRibbonControl, pressed As Boolean)
AddinExpress.MSO.2005.DLL: N 0007 (0x7) IL
AddinExpress.MSO.ADXRibbonButton.DoInternalAction(e As ADXRibbonOnActionEventArgs)
AddinExpress.MSO.2005.DLL: N 0035 (0x23) IL
(Outer Exception)
Date and Time: 4/5/2012 7:24:52 PM
Machine Name: TOM-PC
IP Address: ----------------------
Current User: Tom-PC\Tom
Application Domain: C:\Program Files (x86)\Fintools\Fintools XL\
Assembly Codebase: file:///C:/Program Files (x86)/Fintools/Fintools XL/AddinExpress.MSO.2005.DLL
Assembly Full Name: AddinExpress.MSO.2005, Version=6.5.3057.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 6.5.3057.2005
Exception Source:
Exception Type: AddinExpress.MSO.ADXExternalException
Exception Message: An error has occured in the code of the add-in.
Exception Target Site: Object reference not set to an instance of an object.
---- Stack Trace ----
「AnyCPU」プラットフォームと「x86」プラットフォームの両方でこのプロジェクトを構築しようとしましたが、どちらも機能しませんでした。DLLの64ビットバージョンを使用してみましたが、badimageformat例外が発生し、32ビットバージョンが正しいバージョンであると信じ込ませました。system.data.sqlite.dllをアドインのルートフォルダーとExcelのルートフォルダーの両方に配置しましたが、どちらも問題を解決していません。私は経験の浅い.NETプログラマーですが、私は完全にアイデアがありません。そのため、この問題を解決する方法についてのアドバイスをここで探しています。
ご意見ありがとうございます。