From bb2b9902362ad193266bb52df1ed09f8ec506aa9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 28 Dec 2025 20:02:57 +0000 Subject: [PATCH] fix: Initialize SQLitePCL after extracting native DLL to prevent startup error The SQLitePCLRaw.bundle_e_sqlite3 package was attempting to auto-initialize before the embedded sqlite3.dll was extracted, causing a DllNotFoundException at startup. This fix explicitly initializes SQLitePCL.Batteries_V2 after the native DLL extraction to ensure proper initialization order. Resolves the "System.DllNotFoundException: Dll was not found" error that occurred during SqliteConnection initialization in Database.cs:89. --- Intersect.Editor/Core/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Intersect.Editor/Core/Program.cs b/Intersect.Editor/Core/Program.cs index 53b2156d04..e1292d2b35 100644 --- a/Intersect.Editor/Core/Program.cs +++ b/Intersect.Editor/Core/Program.cs @@ -101,6 +101,12 @@ public static void Main(string[] args) ApplicationContext.CurrentContext.Logger.LogTrace("Libraries unpacked."); + ApplicationContext.CurrentContext.Logger.LogTrace("Initializing SQLite..."); + // Explicitly initialize SQLitePCL after extracting the native DLL + // This must happen before any SqliteConnection is created + SQLitePCL.Batteries_V2.Init(); + ApplicationContext.CurrentContext.Logger.LogTrace("SQLite initialized."); + ApplicationContext.CurrentContext.Logger.LogTrace("Creating forms..."); Globals.UpdateForm = new FrmUpdate(); ApplicationContext.CurrentContext.Logger.LogTrace("Forms created.");