diff --git a/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_funcptrs_notwin.cs b/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_funcptrs_notwin.cs index 90b3ad6e..49d38a9d 100644 --- a/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_funcptrs_notwin.cs +++ b/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_funcptrs_notwin.cs @@ -1555,6 +1555,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlcipher"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_funcptrs_win.cs b/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_funcptrs_win.cs index e3087172..5d8f8827 100644 --- a/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_funcptrs_win.cs +++ b/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_funcptrs_win.cs @@ -1558,6 +1558,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlcipher"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_prenet5_notwin.cs b/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_prenet5_notwin.cs index 405dd115..bfe89086 100644 --- a/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_prenet5_notwin.cs +++ b/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_prenet5_notwin.cs @@ -1548,6 +1548,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlcipher"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_prenet5_win.cs b/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_prenet5_win.cs index a480d858..31397e53 100644 --- a/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_prenet5_win.cs +++ b/src/SQLitePCLRaw.provider.e_sqlcipher/Generated/provider_e_sqlcipher_prenet5_win.cs @@ -1551,6 +1551,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlcipher"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_funcptrs_notwin.cs b/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_funcptrs_notwin.cs index 600af80e..94fc1263 100644 --- a/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_funcptrs_notwin.cs +++ b/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_funcptrs_notwin.cs @@ -1543,6 +1543,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_funcptrs_win.cs b/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_funcptrs_win.cs index 4bda535e..6628cd0f 100644 --- a/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_funcptrs_win.cs +++ b/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_funcptrs_win.cs @@ -1546,6 +1546,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_prenet5_notwin.cs b/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_prenet5_notwin.cs index e2f93925..c43f522e 100644 --- a/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_prenet5_notwin.cs +++ b/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_prenet5_notwin.cs @@ -1536,6 +1536,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_prenet5_win.cs b/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_prenet5_win.cs index 2c5df117..ec3f8c8c 100644 --- a/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_prenet5_win.cs +++ b/src/SQLitePCLRaw.provider.e_sqlite3/Generated/provider_e_sqlite3_prenet5_win.cs @@ -1539,6 +1539,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_funcptrs_notwin.cs b/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_funcptrs_notwin.cs index 1ac0d5f7..3ef61cb7 100644 --- a/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_funcptrs_notwin.cs +++ b/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_funcptrs_notwin.cs @@ -1555,6 +1555,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlite3mc"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_funcptrs_win.cs b/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_funcptrs_win.cs index 05576718..a8340667 100644 --- a/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_funcptrs_win.cs +++ b/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_funcptrs_win.cs @@ -1558,6 +1558,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlite3mc"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_prenet5_notwin.cs b/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_prenet5_notwin.cs index 39de4de1..818ba2ba 100644 --- a/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_prenet5_notwin.cs +++ b/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_prenet5_notwin.cs @@ -1548,6 +1548,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlite3mc"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_prenet5_win.cs b/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_prenet5_win.cs index 91264719..4e0faec6 100644 --- a/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_prenet5_win.cs +++ b/src/SQLitePCLRaw.provider.e_sqlite3mc/Generated/provider_e_sqlite3mc_prenet5_win.cs @@ -1551,6 +1551,18 @@ static class NativeMethods { private const string SQLITE_DLL = "e_sqlite3mc"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.internal/Generated/provider_internal_funcptrs.cs b/src/SQLitePCLRaw.provider.internal/Generated/provider_internal_funcptrs.cs index f54f37e5..1885f052 100644 --- a/src/SQLitePCLRaw.provider.internal/Generated/provider_internal_funcptrs.cs +++ b/src/SQLitePCLRaw.provider.internal/Generated/provider_internal_funcptrs.cs @@ -1549,6 +1549,18 @@ static class NativeMethods { private const string SQLITE_DLL = "__Internal"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_funcptrs_notwin.cs b/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_funcptrs_notwin.cs index 898fa3b1..678ecdb4 100644 --- a/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_funcptrs_notwin.cs +++ b/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_funcptrs_notwin.cs @@ -1555,6 +1555,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlcipher"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_funcptrs_win.cs b/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_funcptrs_win.cs index a57c3d4c..433c0764 100644 --- a/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_funcptrs_win.cs +++ b/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_funcptrs_win.cs @@ -1558,6 +1558,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlcipher"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_prenet5_notwin.cs b/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_prenet5_notwin.cs index aee00615..f5f5eb2a 100644 --- a/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_prenet5_notwin.cs +++ b/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_prenet5_notwin.cs @@ -1548,6 +1548,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlcipher"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_prenet5_win.cs b/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_prenet5_win.cs index 55ac5f14..c6f16bd5 100644 --- a/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_prenet5_win.cs +++ b/src/SQLitePCLRaw.provider.sqlcipher/Generated/provider_sqlcipher_prenet5_win.cs @@ -1551,6 +1551,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlcipher"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_funcptrs_notwin.cs b/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_funcptrs_notwin.cs index 703a25b1..fe1e1c44 100644 --- a/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_funcptrs_notwin.cs +++ b/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_funcptrs_notwin.cs @@ -1543,6 +1543,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_funcptrs_win.cs b/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_funcptrs_win.cs index 012f65f4..a0611b58 100644 --- a/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_funcptrs_win.cs +++ b/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_funcptrs_win.cs @@ -1546,6 +1546,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_prenet5_notwin.cs b/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_prenet5_notwin.cs index 6d44e9a8..cd55cc88 100644 --- a/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_prenet5_notwin.cs +++ b/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_prenet5_notwin.cs @@ -1536,6 +1536,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_prenet5_win.cs b/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_prenet5_win.cs index a84cad2a..a994758a 100644 --- a/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_prenet5_win.cs +++ b/src/SQLitePCLRaw.provider.sqlite3/Generated/provider_sqlite3_prenet5_win.cs @@ -1539,6 +1539,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_funcptrs_notwin.cs b/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_funcptrs_notwin.cs index 7bf65a6e..72ad303e 100644 --- a/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_funcptrs_notwin.cs +++ b/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_funcptrs_notwin.cs @@ -1555,6 +1555,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlite3mc"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_funcptrs_win.cs b/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_funcptrs_win.cs index 5f7e8bcc..6d0198cd 100644 --- a/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_funcptrs_win.cs +++ b/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_funcptrs_win.cs @@ -1558,6 +1558,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlite3mc"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_prenet5_notwin.cs b/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_prenet5_notwin.cs index 8b2b50ba..ab13720e 100644 --- a/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_prenet5_notwin.cs +++ b/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_prenet5_notwin.cs @@ -1548,6 +1548,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlite3mc"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_prenet5_win.cs b/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_prenet5_win.cs index 83a27ebc..145ebb7b 100644 --- a/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_prenet5_win.cs +++ b/src/SQLitePCLRaw.provider.sqlite3mc/Generated/provider_sqlite3mc_prenet5_win.cs @@ -1551,6 +1551,18 @@ static class NativeMethods { private const string SQLITE_DLL = "sqlite3mc"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/SQLitePCLRaw.provider.winsqlite3/Generated/provider_winsqlite3.cs b/src/SQLitePCLRaw.provider.winsqlite3/Generated/provider_winsqlite3.cs index 4e232c80..2f939a35 100644 --- a/src/SQLitePCLRaw.provider.winsqlite3/Generated/provider_winsqlite3.cs +++ b/src/SQLitePCLRaw.provider.winsqlite3/Generated/provider_winsqlite3.cs @@ -1539,6 +1539,18 @@ static class NativeMethods { private const string SQLITE_DLL = "winsqlite3"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + [DllImport(SQLITE_DLL, ExactSpelling=true, CallingConvention = CALLING_CONVENTION)] public static extern unsafe int sqlite3_close(IntPtr db); diff --git a/src/providers/provider.tt b/src/providers/provider.tt index e7f3c92b..5db15aff 100644 --- a/src/providers/provider.tt +++ b/src/providers/provider.tt @@ -1835,6 +1835,18 @@ namespace SQLitePCL #> private const string SQLITE_DLL = "<#= NAME_FOR_DLLIMPORT #>"; +#if NET + static NativeMethods() + { + if (AppContext.TryGetSwitch("SQLitePCL.LinkageType.Static", out bool isStatic) && isStatic) + { + nint selfHandle = NativeLibrary.GetMainProgramHandle(); + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, + (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => selfHandle; + } + } +#endif + <# write_api_entries(KIND); }