VB.Net 编译为 32 位,使用 SQLite 在 64 位机器上运行
情况是这样的 - 我有一个使用 2 个 dll 为 X86 机器编译的 vb.net exe...因为其中一个 dll 仅以 32 位提供,并且我不想处理 32/64 版本,所以我在编译选项中强制使用 32 位,一切都很好。现在我有一个 64 位工作站,它抛出一个有关 sqlite.dll 的错误(下面的错误#1)...在阅读完周围内容后,我开始了解到很多人都遇到了这个问题。我尝试用 64 位版本的 sqlite 替换客户端计算机上的 dll,但这不起作用(错误#2)。我在某处读到64位版本需要VC 2010 redistro,但这不起作用。我无法将此应用程序编译为 64 位,因为另一个 dll 是 32 位。非常感谢任何帮助。
错误#1 - System.InvalidOperationException:没有与此命令关联的连接
错误#2 - System.BadImageFormatException:无法加载文件或程序集“System.Data.SQLite,版本” =1.0.79.0、Culture=neutral、PublicKeyToken=db937bc2d44ff139' 或其依赖项之一。尝试加载格式不正确的程序。 文件名:'System.Data.SQLite,版本=1.0.79.0,文化=中性,PublicKeyToken=db937bc2d44ff139'
Here's the situation - I have a vb.net exe compiled for X86 machines using 2 dll's... Because one of the dll's was only provided in 32 bit, and I didn't want to have to deal with 32/64 versions, I forced 32 bit in compile options and everything was fine. Now I have a 64 bit workstation that is throwing an error about the sqlite.dll (error #1 below)... after reading around I am starting to understand a lot of people are having this issue. I tried replacing the dll on the client machine with the 64 bit version of sqlite and that didn't work (error #2). I read somewhere that the 64 bit version requires VC 2010 redistro, but that didn't work. I can't compile this app as a 64 bit because of the other dll is 32 bit. Any help is greatly appreciated.
Error #1 - System.InvalidOperationException: No connection associated with this command
Error #2 - System.BadImageFormatException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.79.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'System.Data.SQLite, Version=1.0.79.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您绝对确定您的应用程序是在 x86 下编译的,而不是 AnyCPU 下吗?当处理像 SQLLite 这样为 x86 编译的 dll 时,您的进程必须在 x86 模式下运行。
Are you absolutely sure that you've compiled your application under x86, not AnyCPU? When dealing with dlls like SQLLite that are compiled for x86, your process must be running in x86 mode.