connercsbn / SimpleAdmin

12 stars 2 forks source link

[BUG]: [WINDOWS] System.DllNotFoundException: Unable to load DLL 'e_sqlite3' or one of its dependencies: The specified module could not be found. #4

Closed kus closed 4 months ago

kus commented 4 months ago

On Windows it is unable to load the DLL e_sqlite3 but the exact same files on Ubuntu works.

You can see the files I'm using here.

19:14:04 [INFO] (cssharp:PluginContext) Loading plugin SimpleAdmin
19:14:04 [EROR] (cssharp:PluginManager) Failed to load plugin from D:\git\cs2-modded-server\server\game\csgo\addons\counterstrikesharp\plugins\SimpleAdmin\SimpleAdmin.dll
System.TypeInitializationException: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.DllNotFoundException: Unable to load DLL 'e_sqlite3' or one of its dependencies: The specified module could not be found. (0x8007007E)
   at SQLitePCL.SQLite3Provider_e_sqlite3.NativeMethods.sqlite3_libversion_number()
   at SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number()
   at SQLitePCL.raw.SetProvider(ISQLite3Provider imp)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Microsoft.Data.Sqlite.SqliteConnection..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
   at SimpleAdmin.SimpleAdmin.InitDatabase() in C:\Users\conne\source\repos\cs2-plugins\SimpleAdmin\SimpleAdmin.cs:line 25
   at SimpleAdmin.SimpleAdmin.Load(Boolean hotReload) in C:\Users\conne\source\repos\cs2-plugins\SimpleAdmin\SimpleAdmin.cs:line 191
   at CounterStrikeSharp.API.Core.Plugin.PluginContext.Load(Boolean hotReload) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/PluginContext.cs:line 218
   at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.LoadPlugin(String path) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 125
   at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.Load() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 93
connercsbn commented 4 months ago

I think I accidentally left out the e_sqlite3.dll file when I published this. I'll try to fix this in the next day. Thanks for the detailed report!

connercsbn commented 4 months ago

@kus I recompiled it as os-agnostic and included the necessary Sqlite dependencies, so hopefully it should work on both Linux and Windows servers. I haven't tested it yet, as CSS isn't loading on my Linux server right now, so please test for me if you can! Otherwise, I'll try to test it tonight.

Here's the build: https://github.com/connercsbn/SimpleAdmin/releases/tag/v0.1.2-recompile

connercsbn commented 4 months ago

@kus Ok, works on both Windows and Linux. I just replaced the build asset for release v0.1.2, which has all the right files included. lmk if there's anything else I can help with

kus commented 4 months ago

@connercsbn I have tested the new build on Windows and Ubuntu on my end too. Works great.

Thank you for the quick turn around!