Skip to content

Check AppContext.BaseDirectory for powersync.dll#28

Merged
LucDeCaf merged 3 commits intomainfrom
fix/load-ext-in-packaged-apps
Jan 9, 2026
Merged

Check AppContext.BaseDirectory for powersync.dll#28
LucDeCaf merged 3 commits intomainfrom
fix/load-ext-in-packaged-apps

Conversation

@LucDeCaf
Copy link
Copy Markdown
Contributor

@LucDeCaf LucDeCaf commented Dec 31, 2025

Fixes #14 by checking the application's base directory for the PowerSync SQLite3 extension library.

Currently, PowerSync.Common only checks the "portable deployment" path (<approot>/runtimes/<rid>/native/powersync.{dylib,so,dll}) for the extension. However, there a number of technologies (Windows Application Packaging projects, .NET Framework 4.8, etc.) which don't follow this convention and instead place all shared libraries in the same directory as the executable. This PR adds a check to see if it can find powersync.{dylib,so,dll} in the root folder, and if so, loads that library instead of searching for the runtimes/<rid>/native one.

I considered allowing the user to configure the path to check for powersync.dll, but decided against it since practically all .NET apps use either the flattened deployment or the structured runtimes/<rid>/native deployment already.

@LucDeCaf LucDeCaf requested a review from Chriztiaan December 31, 2025 10:02
Copy link
Copy Markdown
Collaborator

@Chriztiaan Chriztiaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for looking into this!

Chriztiaan
Chriztiaan previously approved these changes Jan 5, 2026
@LucDeCaf LucDeCaf merged commit 1d81fdc into main Jan 9, 2026
1 check passed
@LucDeCaf LucDeCaf deleted the fix/load-ext-in-packaged-apps branch January 9, 2026 08:21
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

Successfully merging this pull request may close these issues.

Error when packaging the app as .appxupload

2 participants