praeclarum/sqlite-net

e_sqlite.dll is created but not showing an error when using it.

Test112-error opened this issue · 0 comments

Description:
VS 2022
.netframework 4.6.2
Microsoft.EntityFrameworkCore.Sqlite 3.1.0.0 and its dependent libraries

SQLitePCLRaw.bundle_e_sqlite3.2.0.2
SQLitePCLRaw.bundle_green.2.1.8
SQLitePCLRaw.core.2.1.8 and related libraries of same versions

e_sqlite.dll are created for both x86 and x64 architecture.
project in build in AnyCPU

issue:
the issue is when i run the application in AnyCPU or x64 bit architecture
when i run the appliction
GetChargeTimePreset_Success Failed: System.TypeInitializationException : The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. 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.Exception : Library e_sqlite3 not found plat: win suffix: DLL possibilities (3): 1) C:\workspace1\biomedical\src\Tests\Fluke.OneQa.Local.Api.IntegrationTests\bin\Debug\runtimes\win-x64\native\e_sqlite3.dll 2) C:\workspace1\biomedical\src\Tests\Fluke.OneQa.Local.Api.IntegrationTests\bin\Debug\e_sqlite3.dll 3) C:/workspace1/biomedical/src/Tests/Fluke.OneQa.Local.Api.IntegrationTests/bin/Debug/e_sqlite3.dll win TryLoad: C:\workspace1\biomedical\src\Tests\Fluke.OneQa.Local.Api.IntegrationTests\bin\Debug\runtimes\win-x64\native\e_sqlite3.dll thrown: System.ComponentModel.Win32Exception (0x80004005): %1 is not a valid Win32 application at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action1 log, IntPtr& h)
win TryLoad: C:\workspace1\biomedical\src\Tests\Fluke.OneQa.Local.Api.IntegrationTests\bin\Debug\e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action1 log, IntPtr& h) win TryLoad: C:/workspace1/biomedical/src/Tests/Fluke.OneQa.Local.Api.IntegrationTests/bin/Debug/e_sqlite3.dll thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action1 log, IntPtr& h)
NOT FOUND

at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
at Fluke.Core.Shared.Tests.Attributes.Services.CreateLocalDatabaseAttributeService3.CreateConnection() in C:\workspace1\biomedical\core\src\Shared\Fluke.Core.Shared.Tests\Attributes\Services\CreateLocalDatabaseAttributeService.cs:line 20 at Fluke.Core.Shared.Tests.Attributes.Services.CreateLocalDatabaseAttributeService3.BeforeTest(ITest test, Boolean setContextFactory) in C:\workspace1\biomedical\core\src\Shared\Fluke.Core.Shared.Tests\Attributes\Services\CreateLocalDatabaseAttributeService.cs:line 38
at Fluke.Core.Shared.Tests.Attributes.Services.CreateLocalConnectionAndRemoteContextAttributeService`5.BeforeTest(ITest test) in C:\workspace1\biomedical\core\src\Shared\Fluke.Core.Shared.Tests\Attributes\Services\CreateLocalConnectionAndRemoteContextAttributeService.cs:line 30
at Fluke.OneQa.Tests.Attributes.OneQaCreateLocalConnectionAndRemoteContextAttribute.BeforeTest(ITest test) in C:\workspace1\biomedical\src\Tests\Fluke.OneQa.Tests\Attributes\OneQaCreateLocalConnectionAndRemoteContextAttribute.cs:line 33
at NUnit.Framework.Internal.Commands.TestActionCommand.<>c__DisplayClass0_0.<.ctor>b__0(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.b__0()
at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
--TargetInvocationException
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Data.Sqlite.Utilities.BundleInitializer.Initialize()
at Microsoft.Data.Sqlite.SqliteConnection..cctor()
--Exception
at SQLitePCL.NativeLibrary.Load(String libraryName, Assembly assy, Int32 flags)
at SQLitePCL.Batteries_V2.MakeDynamic(String name, Int32 flags)
at SQLitePCL.Batteries_V2.DoDynamic_cdecl(String name, Int32 flags)

`

it works fine for x86, when i run in anyother architecture i see this issue