1

我和我的朋友目前正在一个程序中使用 sql lite 数据库。当他编译项目时,数据库加载没有任何问题。但是当我尝试编译项目(工作正常)并加载数据库时,出现以下错误:

System.BadImageFormatException 未处理 HResult=-2147024885 Message=Die Datei oder Assembly "System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" oder eine Abhängigkeit davon wurde nicht gefunden。Es wurde versucht, eine Datei mit einem falschen Format zu laden。Source=PrisonArchitectSavegameEditor FileName=System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139 FusionLog==== Zusstandsinformationen vor Bindung === LOG: Benutzer = TIETZE\tietze111 LOG: DisplayName = System.Data。 SQLite,版本=1.0.66.0,文化=中性,PublicKeyToken=db937bc2d44ff139(完全指定)日志:Appbase = file:///D:/Dropbox/C#/WIP/PrisonArchitectSavegameEditor/PrisonArchitectSavegameEditor/bin/Release/ 日志:Ursprünglicher PrivatePath = 空

Aufruf von Assembly:PrisonArchitectSavegameEditor,版本=2.2.1.0,文化=中性,PublicKeyToken=null。

LOG: Diese Bindung startet im default-Load-Kontext。LOG: Die Anwendungskonfigurationsdatei wird verwendet: D:\Dropbox\C#\WIP\PrisonArchitectSavegameEditor\PrisonArchitectSavegameEditor\bin\Release\PrisonArchitectSavegameEditor.vshost.exe.Config LOG: Die Hostkonfigurationsdatei wird verwendet: LOG: Die Computerkonfigurationsdatei von C:\Windows\Microsoft。 NET\Framework64\v4.0.30319\config\machine.config wird verwendet。LOG: Verweis nach der Richtlinie: System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139 LOG: Download von neuem URL file:///D:/Dropbox/C#/WIP/PrisonArchitectSavegameEditor/PrisonArchitectSavegameEditor/ bin/Release/System.Data.SQLite.DLL。ERR: Das Setup der Assembly konnte nicht abgeschlossen werden (hr = 0x8007000b)。Die Suche wurde bedet。

堆栈跟踪:

  bei PrisonArchitectSavegameEditor.Form1.LoadDatabase()
   bei PrisonArchitectSavegameEditor.Form1.tabControlSaveGameActions_SelectedIndexChanged(Object sender, EventArgs e) in d:\Dropbox\C#\WIP\PrisonArchitectSavegameEditor\PrisonArchitectSavegameEditor\Form1.cs:Zeile 652.
   bei System.Windows.Forms.TabControl.OnSelectedIndexChanged(EventArgs e)
   bei System.Windows.Forms.TabControl.WmSelChange()
   bei System.Windows.Forms.TabControl.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   bei System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.Control.WmNotify(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.Form.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   bei System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   bei System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.TabControl.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei PrisonArchitectSavegameEditor.Program.Main() in d:\Dropbox\C#\WIP\PrisonArchitectSavegameEditor\PrisonArchitectSavegameEditor\Program.cs:Zeile 20.
   bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   bei System.Threading.ThreadHelper.ThreadStart()

内部异常:

当我启动他编译的exe时也会出现错误。调用函数而不是函数本身时也会出现错误: 错误

先感谢您!

4

2 回答 2

1

您可能只需要为 SQLLite 安装提供程序:

http://sqlite.phxsoftware.com/

于 2012-10-25T12:13:50.110 回答
0

尝试更改 Visual Studio处理器架构

于 2017-08-09T06:54:09.253 回答