diff --git a/Realm/Realm/Native/NativeCommon.cs b/Realm/Realm/Native/NativeCommon.cs index f389d9e1b2..3b482393c8 100644 --- a/Realm/Realm/Native/NativeCommon.cs +++ b/Realm/Realm/Native/NativeCommon.cs @@ -51,6 +51,14 @@ internal static void Initialize() if (libraryName == InteropConfig.DLL_NAME) { libraryName = "@rpath/realm-wrappers.framework/realm-wrappers"; + + var runtimeVersion = Environment.Version; + if (runtimeVersion.Major >= 10) + { + // .NET 10 breaking change: Application directory is no longer used when searching for DLLs + // We need to explicitly add it to the search path + searchPath |= DllImportSearchPath.ApplicationDirectory; + } } return NativeLibrary.Load(libraryName, assembly, searchPath);