简体   繁体   中英

Sqlite-net hanging call on Windows 10

So I've been working on a desktop application that utilizes SQLite for storage of some per-execution data. We're working in C#, .NET 4.5, Visual Studio 2012, using the following nuget packages to support out SQLite needs:

  • sqlite-net
  • System.Data.SQLite (x86/x64)
  • System.Data.SQLite Core (x86/x64)
  • System.Data.SQLite EF6
  • System.Data.SQLite LINQ

These packages install two files: SQLite.cs and SQLiteAsync.cs into the project, managed code. However we needed to go seek out sqlite3.dll in order to support these files' calls to unmanaged code. This file is included at the root level of the project and is copied to the bin on build.

Now, we began development on Windows 8.1 and were able to successfully use SQLite to create/update .sqlite DB files. Then came the switch to Windows 10 (it's free, this is now the most important platform to support) and now any call to the unmanaged code (sqlite3.dll) HANGS . Hanging is the worst, no exceptions, no clues, unmanaged code = no debugging. Can I get an amen?

The hang happens on SQLite3.Open , here is the call stack (that I had to piece together, I hate hangs...)

**HANGS AT THIS CALL: SQLite3.Open**
var r = SQLite3.Open(databasePathAsBytes, out handle, (int) openFlags, IntPtr.Zero) in SQLite.cs 
: base(SQLiteConnectionString.DatabasePath, SQLIteOpenFlags, SQLiteConnectionString.StoreDateTimeAsTicks) in SQLite.cs
Connection = new SQLiteConnectionWithLock(SQLiteConnectionString, SQLIteOpenFlags) in SQLiteAsync.cs
entry = new Entry(SQLiteConnectionString, SQLIteOpenFlags) in SQLiteAsync.cs 
return SQLiteConnectionPool.Shared.GetConnection(SQLiteConnectionString, SQLIteOpenFlags) in SQLiteAsync.cs 
var conn = this.GetConnection() in SQLiteAsync.cs (their code)
Task initTask = db.RunInTransactionAsync(...) in SQLFacade.cs (our code)

I hope that isn't too difficult to read.

Anyways, I'm hoping that somebody out there has some insight into why this is happening suddenly. I've tried reinstalling all of the nuget packages and getting the latest sqlite3.dll to no avail. In the meantime I will be checking with Windows Defender and Bitdefender (my chosen antivirus) to see if perhaps they're blocking access to sqlite3.dll for some reason.

If anyone has contact with a member of the SQLite team please reference to them this post, this snag is a HUGE roadblock for our team's progress.

Thanks SO!

BIG, BIG SIGH

I was on the wrong build configs. We're building a 64-bit app, somehow my project build configs were x86 across the board. sqlite3.dll is a 64 bit library. If it were the other way around I would have seen a BadImageFormatException, in this case I got a hang.

Ah the programmer's life.

I hope this post helps SOMEBODY, otherwise it will forever live on my wall of shame.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM