Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-1012

Error on Realm.GetInstance on windows

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      What happened?

      When running a MAUI windows app, the first time .GetInstance is called an error happens:

      LockFileEx() failed: unknown error

      Repro steps

      If you simply run your sample project then this error happens.

      (I had to add a Properties folder with a launchSettings.json containing:
      {
      "profiles": {
      "Windows Machine":

      { "commandName": "MsixPackage", "nativeDebugging": false }

      }
      }
      To even get the Windows app to run.

      Version

      .NET 7

      What Atlas Services are you using?

      Local Database only

      What type of application is this?

      Other

      Client OS and version

      Windows 10

      Code snippets

      No response

      Stacktrace of the exception/crash you're getting

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      at Realms.NativeException.ThrowIfNecessary()
         at Realms.SharedRealmHandle.Open(Configuration configuration, RealmSchema schema, Byte[] encryptionKey)
         at Realms.RealmConfiguration.CreateHandle(RealmSchema schema)
         at Realms.RealmConfigurationBase.CreateRealm()
         at Realms.Realm.GetInstance(RealmConfigurationBase config)
         at QuickJournal.ViewModels.JournalEntriesViewModel..ctor() in D:\Development\realm-dotnet-main\examples\QuickJournal\ViewModels\JournalEntriesViewModel.cs:line 23
         at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
      

      Relevant log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      LockFileEx() failed: unknown error
      

            Assignee:
            ferdinando.papale@mongodb.com Ferdinando Papale
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: