I'm using the sqlite-net-pcl nuget package (version 1.8.116) in a .Net framework 4.8 Winforms Application. It seems to have a .NET Standard dependency.
When running from the Visual Studio environment, the SQLite libraries initialize without any problems and the necessary read/write aspects of the libraries work as expected.
However, when deploying to a different folder, the application throws an unhandled exception. My windows event viewer provides the following information.
`Exception Info: System.Exception at SQLitePCL.NativeLibrary.Load(System.String, System.Reflection.Assembly, Int32) at SQLitePCL.Batteries_V2.MakeDynamic(System.String, Int32) at SQLitePCL.Batteries_V2.DoDynamic_cdecl(System.String, Int32) at SQLite.SQLiteConnection..cctor()
Exception Info: System.TypeInitializationException at SQLite.SQLiteConnection..ctor(SQLite.SQLiteConnectionString) at SQLite.SQLiteConnectionPool+Entry..ctor(SQLite.SQLiteConnectionString) at SQLite.SQLiteConnectionPool.GetConnectionAndTransactionLock(SQLite.SQLiteConnectionString, System.Object ByRef) at SQLite.SQLiteAsyncConnection+<>c__DisplayClass33_0
1[[SQLite.CreateTableResult, SQLite-net, Version=1.8.116.0, Culture=neutral, PublicKeyToken=null]].<WriteAsync>b__0() at System.Threading.Tasks.Task1[[SQLite.CreateTableResult, SQLite-net, Version=1.8.116.0, Culture=neutral, PublicKeyToken=null]].InnerInvoke() at System.Threading.Tasks.Task.Execute()
The following SQlite DLL files are in the deployment folder
SQLite-net.dll SQLitePCLRaw.batteries_v2.dll SQLitePCLRaw.nativelibrary.dll SQLitePCLRaw.provider.dynamic_cdecl.dll SQLitePCLRaw.core.dll
How to resolve this unhandled exception?