oysteinkrog / SQLite.Net-PCL

Simple, powerful, cross-platform SQLite client and ORM - Updated version with PCL support
MIT License
353 stars 162 forks source link

UWP: Crash in .NET native release builds when consuming winsqlite3.dll #375

Open rigdern opened 6 years ago

rigdern commented 6 years ago

Two changes need to be made to all of the DllImports for "winsqlite3":

  1. Calling convention has to be switched from Cdecl to StdCall
  2. ExactSpelling has to be set to true

For example:

[DllImport("winsqlite3", EntryPoint = "sqlite3_open", CallingConvention = CallingConvention.Cdecl)]

should be:

[DllImport("winsqlite3", EntryPoint = "sqlite3_open", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]