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

“Unable to load DLL 'realm-wrappers'” exception with Realm 10 and Windows 8.1 #2298

Closed
1 of 3 tasks
andlang opened this issue Mar 17, 2021 · 11 comments
Closed
1 of 3 tasks
Assignees

Comments

@andlang
Copy link

andlang commented Mar 17, 2021

Goals

I would like to use Realm 10 in a simple .NET Core CLI on Windows 8.1 in order to generate a database that I can use in apps. Everything is locally without any cloud services.

Expected Results

Program runs without exception like it does with Realm v5.1.3.

Actual Results

With Realm v10.1.1 I get following exception (with Realm v5.1.3 everything works as expected):

Unhandled exception. System.TypeInitializationException: The type initializer for 'Realms.SharedRealmHandle' threw an exception.
 ---> System.DllNotFoundException: Unable to load DLL 'realm-wrappers' or one of its dependencies: Das angegebene Modul wurde nicht gefunden. (0x8007007E)
   at Realms.SynchronizationContextScheduler.install_scheduler_callbacks(get_context get, post_on_context post, release_context release, is_on_context is_on)
   at Realms.SynchronizationContextScheduler.Install()
   at Realms.NativeCommon.Initialize()
   at Realms.SharedRealmHandle..cctor()
   --- End of inner exception stack trace ---
   at Realms.SharedRealmHandle.Open(Configuration configuration, RealmSchema schema, Byte[] encryptionKey)
   at Realms.RealmConfiguration.CreateRealm(RealmSchema schema)
   at Realms.RealmConfiguration.<>c__DisplayClass25_0.<CreateRealmAsync>b__1(Task _)
   at System.Threading.Tasks.ContinuationResultTaskFromTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

Steps to Reproduce

Build and run the program below with Realm 10 on Windows 8.1

Code Sample

From https://docs.mongodb.com/realm/dotnet/async-console/

public static void Main(string[] args)
{
    AsyncContext.Run(async () => await MainAsync(args));
}

private static async Task MainAsync(string[] args)
{
    using var realm = await Realm.GetInstanceAsync();
    var foos = realm.All<Foo>().Where(f => f.Bar > 5);
    foreach (var foo in foos)
    {
        await Task.Delay(10); // Simulates some background work
        Console.WriteLine(foo.Bar);
    }
}

Version of Realm and Tooling

  • Flavor:
    • Realm Cloud
    • Self-Hosted
    • Local DB
  • OS & Version: Windows 8.1
  • SDK Version: Realm v10.1.1
  • Target: .NET Core 3.1
@LaPeste
Copy link
Contributor

LaPeste commented Mar 17, 2021

Hi andlang,

I tried the code sample that you submitted in a new CLI project targeting .Net Core 3.1 on Windows 10.
There is no issue building and running the test project. However, we've seen in the past people having issues while updating realm versions. Please try to delete your build folder (clean the entire solution) and try to build again.

Andrea

@andlang
Copy link
Author

andlang commented Mar 18, 2021

Hi Andrea,

I cleaned the build folder and still get the same error. But for compatibility reasons, I run it with Windows 8.1 and not with Windows 10. Could you try, if it works for you with Windows 8.1? Or is that version not supported anymore?

Andreas

@nirinchev
Copy link
Member

8.1 should be supported, but admittedly we don't run automated tests for it. I think I have a VM with 8.1 that I can try running on.

@nirinchev nirinchev self-assigned this Mar 18, 2021
@nirinchev
Copy link
Member

I did repro it on Win 8.1 - seems like NuGet doesn't resolve the correct dependency here - I'll keep looking.

@nirinchev
Copy link
Member

We were able to track it down to our Core database accidentally using a Win10 API. We'll fix it with the next release. Unfortunately, there are no known workarounds at the moment besides upgrading to Win10, I am sorry about that 😔

@sync-by-unito sync-by-unito bot assigned fealebenpae and unassigned nirinchev and LaPeste Apr 2, 2021
@markusroessler
Copy link

The same exception occurs on Windows Server 2012 R2. When will the fix/next release arrive?

@andlang
Copy link
Author

andlang commented May 11, 2021

@nirinchev Do you have any updates on that? Will it be fixed in the upcoming 10.2.0?

@nirinchev
Copy link
Member

We don't have an update unfortunately - the accidental usage of a Win10 API turned out to be a false lead. We could still repro even after removing it. I'll ping the Core team to see if there have been any developments.

@nirinchev
Copy link
Member

This has been resolved and will be included in the next release.

@movsar
Copy link

movsar commented Feb 25, 2024

What the hell? why can't you really fix it instead of saying - you should upgrade to windows 10? I got a project specifically for windows 7 and unfortunately I was using Realm from ground up, now it seems the only option is to change my DBMS, this is really bad.

@nirinchev
Copy link
Member

The compatibility section of the docs clearly states that Windows 8.1 is the lowest supported version. I'm sorry that this doesn't fit your use case, but it's well documented and I don't see what more we could do there. Supporting Windows 7 is not trivial and support for it from Microsoft ended 4 years ago so we don't plan to invest time and effort in doing it unless there's a major commercial use case.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants