Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions PowerSync/PowerSync.Common/Utils/PowerSyncPathResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ public static string GetNativeLibraryPath(string packagePath)
return Path.Combine(AppContext.BaseDirectory, "powersync.dll");
}

string fileName = GetFileNameForPlatform();

// Packaged MSIX/Appx applications flatten all DLLs into one folder
string flattenedPath = Path.Combine(packagePath, fileName);
if (File.Exists(flattenedPath))
{
return flattenedPath;
}

string rid = GetRuntimeIdentifier();
string nativeDir = Path.Combine(packagePath, "runtimes", rid, "native");

string fileName = GetFileNameForPlatform();

return Path.Combine(nativeDir, fileName);
}

Expand Down Expand Up @@ -63,4 +70,4 @@ private static string GetFileNameForPlatform()
throw new PlatformNotSupportedException("Unsupported platform.");
}
}
}
}