praeclarum / sqlite-net

Simple, powerful, cross-platform SQLite client and ORM for .NET
MIT License
4.01k stars 1.42k forks source link

Add Web Assembly support #1114

Open nesbox opened 2 years ago

nesbox commented 2 years ago

When I try to create a DB in WASM app I get an error dotnet.js:1 ---> System.DllNotFoundException: e_sqlcipher

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'SQLite.SQLiteConnection' threw an exception.
dotnet.js:1  ---> System.DllNotFoundException: e_sqlcipher
dotnet.js:1    at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable`1 searchPath, Boolean throwOnError) in D:\a\Uno.DotnetRuntime.WebAssembly\Uno.DotnetRuntime.WebAssembly\runtime\src\mono\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.Mono.cs:line 13
dotnet.js:1    at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 searchPath) in D:\a\Uno.DotnetRuntime.WebAssembly\Uno.DotnetRuntime.WebAssembly\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.cs:line 94
dotnet.js:1    at SQLitePCL.NativeLibrary.Load(String libraryName, Assembly assy, Int32 flags)
dotnet.js:1    at SQLitePCL.Batteries_V2.MakeDynamic(String name, Int32 flags)
dotnet.js:1    at SQLitePCL.Batteries_V2.DoDynamic_cdecl(String name, Int32 flags)
dotnet.js:1    at SQLitePCL.Batteries_V2.Init()
dotnet.js:1    at SQLite.SQLiteConnection..cctor()
dotnet.js:1    --- End of inner exception stack trace ---
ericsink commented 2 years ago

Have you tried this with the latest pre-release of SQLitePCLRaw?

nesbox commented 2 years ago

I'll try and let you know, thanks.