Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT FOUND error with win-x86 process running on ARM64 silicon #617

Open
hatton opened this issue Jan 16, 2025 · 0 comments
Open

NOT FOUND error with win-x86 process running on ARM64 silicon #617

hatton opened this issue Jan 16, 2025 · 0 comments

Comments

@hatton
Copy link

hatton commented Jan 16, 2025

What version of SQLitePCLRaw are you using? 2.1.2

If you are using one of the SQLitePCLRaw bundle packages, which one? bundle_green

What platform are you running on? Windows
What operating system? Windows 11 ARM64
Which version?
What CPU? Snapdragon Elite and Apple M4

What target framework are you building for? .net 4.7.2

Are you on .NET Framework or the newer stuff (.NET Core, .NET 5+, etc)? .NET Framework

Are you using the command line, or an IDE? Which IDE? Which version of that IDE? Runs fine from Visual Studio 2022, problem appears in installer version, which is created with msbuild.

Is this problem something that just started happening? For example, were things working well for you and then you updated something and then the problem showed up? What changed? The thing that is new is the ARM64 machines.

What is the exact error message you are seeing when the problem happens?

Msg: Library e_sqlite3 not found
plat: win
suffix: DLL
possibilities (2):
    1) C:\Users\hatto\AppData\Local\BloomAlpha\app-6.2.1129\runtimes\**win-arm64**\native\e_sqlite3.dll
    2) C:\Users\hatto\AppData\Local\BloomAlpha\app-6.2.1129\e_sqlite3.dll
win TryLoad: C:\Users\hatto\AppData\Local\BloomAlpha\app-6.2.1129\runtimes\win-arm64\native\e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): %1 is not a valid Win32 application
   at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action`1 log, IntPtr& h)
win TryLoad: C:\Users\hatto\AppData\Local\BloomAlpha\app-6.2.1129\e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
   at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action`1 log, IntPtr& h)
NOT FOUND

Are you using PackageReference or packages.config? PackageReference

		<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
		<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.2" />
		<PackageReference Include="SQLitePCLRaw.core" Version="2.1.2" />
		<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.1.2" />
		<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.1.2" />

Sometimes other packages using SQLitePCLRaw cause problems when they are mixed together. What other packages are you including in your project? We are using sqlite-net.

How can we reproduce the problem you are seeing? Your issue will get attention much faster if you attach a minimal reproduction sample project.

We could create something minimal if you decide this is worth fixing. We understand that this is a very legacy app running into some modern challenges. We expect that the most we can hope for is a greater understanding of what the expected behavior is?

If I'm reading it correctly, SQLitePCL.raw uses RuntimeInformation.OSArchitecture to decide which dll to load. So on ARM64 hardware, it naturally tries to load the ARM64 version of e_sqlite3.dll. However, since our process is x86, and Windows 11 ARM64 is handling that conversion, it can't handle an ARM64 dll and it all fails with is not a valid Win32 application

We are working around this by copying the x86 version into one of the places that TryLoad() is looking.

Perhaps you can advise if this is the best approach? Thanks so much!

hatton added a commit to BloomBooks/BloomDesktop that referenced this issue Jan 16, 2025
hatton added a commit to BloomBooks/BloomDesktop that referenced this issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant