首页 > 解决方案 > 使用 SQLite 调试 x64

问题描述

我在项目中使用 SQLite

我测试过:

当我想在 x64 中调试时出现错误这是必要的,因为我在 x64 中使用了外部 DLL ( DllImport)

SQLite error (1): no such table: MAIN in "SELECT ID FROM MAIN"
Exception thrown: 'System.Data.SQLite.SQLiteException' in System.Data.SQLite.dll
An exception of type 'System.Data.SQLite.SQLiteException' occurred in System.Data.SQLite.dll but was not handled in user code
SQL logic error
no such table: MAIN

怎么了?

标签: c#wpf

解决方案


欢迎来到 SO!

听起来您加载了错误版本的 DLL,我自己过去也遇到过这样的问题。确保在运行时检查您是在 32 位还是 64 位模式下运行,然后加载适当的 DLL。更好的是,运行 NuGet Manager 并从那里将 SQLite 添加到您的项目中,该版本支持两者。


推荐阅读