我在visual studio 2010中创建安装项目时遇到了一些问题。我正在使用Addin-express制作一个与Microsoft Excel相关联的程序,并在其中使用SQLite创建一个简单的数据库。我在stackoverflow上读过其他答案,但他们的解决方案对我没有帮助。
我正在使用可以在http://sqlite.phxsoftware.com上找到的SQLite.net。我无法连接到该网站,因此直接链接到动态链接库是http://sourceforge.net/projects/sqlite-dotnet2/
这个插件使用的是32位版本的Microsoft Office Excel,尽管我运行的是64位windows 7,因此我在Visual Studio2010项目中包含了32位版本的dll。我在Visual Studio调试中运行32位dll没有任何问题,因此我在Visual Studio安装项目中包含了相同的dll。但是,当我在我的虚拟机(也是64位Windows 7)上运行此安装程序时,我收到以下错误和堆栈跟踪:
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 ----我尝试过在"Any CPU“和"x86”平台上构建这个项目,但都没有成功。我尝试过使用64位版本的DLL,但它给出了badimageformat异常,这让我相信32位版本是可以使用的正确版本。我已经将system.data.sqlite.dll放在我的外接程序的根文件夹和excel的根文件夹中,但两者都没有解决我的问题。我完全没有想法,虽然我是一个没有经验的.NET程序员,所以我在这里寻找如何解决这个问题的建议。
感谢您的意见。
发布于 2012-04-06 15:41:15
请使用支持sqlite和.Net最新版本的更新的system.data.sqlite.dll:
http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
https://stackoverflow.com/questions/10039702
复制相似问题