I just follow the instruction at
SQLite-on-Visual-Studio-with-NuGet-and-Easy-Instructions
and I can able to compile sample C# appliation with
"any cpu"
option.
But when I run application, if I choose
"prefer 32 bit"
option, my application crash:
"Unable to load DLL "SQLite.Interop.dll"
If I uncheck "prefer 32 bit" option it works fine on my 64 bit machine.
Why this happen?Any suggestion to fix it?
PS: I use 64 bit Windows 8. and I provide [x86] and [x64] folders for SQLite.
PS 1: Error:
System.TypeInitializationException: The type initializer for 'System.Data.SQLite.SQLiteFactory' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op) at System.Data.SQLite.SQLite3.StaticIsInitialized() at System.Data.SQLite.SQLiteLog.Initialize() at System.Data.SQLite.SQLiteFactory..cctor() --- End of inner exception stack trace --- at System.Data.SQLite.SQLiteFactory..ctor()
PS 3:
I notice an interesting thing. Although at visual studio it craches, when i run my program exe, by just clicking it, it works.