Skip to content

Commit cd92908

Browse files
committed
Check package root for powersync.dll
1 parent 20a7807 commit cd92908

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

PowerSync/PowerSync.Common/Utils/PowerSyncPathResolver.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ public static string GetNativeLibraryPath(string packagePath)
1313
return Path.Combine(AppContext.BaseDirectory, "powersync.dll");
1414
}
1515

16+
string fileName = GetFileNameForPlatform();
17+
18+
// Packaged MSIX/Appx applications flatten all DLLs into one folder
19+
string flattenedPath = Path.Combine(packagePath, fileName);
20+
if (File.Exists(flattenedPath))
21+
{
22+
return flattenedPath;
23+
}
24+
1625
string rid = GetRuntimeIdentifier();
1726
string nativeDir = Path.Combine(packagePath, "runtimes", rid, "native");
1827

19-
string fileName = GetFileNameForPlatform();
20-
2128
return Path.Combine(nativeDir, fileName);
2229
}
2330

@@ -63,4 +70,4 @@ private static string GetFileNameForPlatform()
6370
throw new PlatformNotSupportedException("Unsupported platform.");
6471
}
6572
}
66-
}
73+
}

0 commit comments

Comments
 (0)