-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
1 - XS (<= 1 day)
-
3436
What happened?
I'm working on a project that is using .Net Framework 4.8 and have been having great success with Realm. It's an amazing project!
However, I am unable to use the IRealmObject interface when implementing a realm class, as the docs suggest. Instead I can use the older approach of subclassing RealmObject. It sounds like this is deprecated and will eventually be unsupported or removed. Interfaces are much more flexible so I would prefer to switch to them.
I created two VS projects, one using Framework 4.8 that shows the errors I mentioned and another using .Net 7 which works as expected. Here is the repo with the example code: https://github.com/crleblanc/realm-dotnet-interfaces.
The NuGet Realm package indicates Net Standard 2.0 is supported, and Framework 4.8 conforms to this.
The errors I'm getting at build time for this example are mentioned in the log output section of this report.
My guess would be there's an issue with the Fody generator but I'm new to C# so that's just a guess.
Thanks for any help.
Repro steps
- Clone the files in https://github.com/crleblanc/realm-dotnet-interfaces.
- Restore the nuget packages for the realm-dotnet-framework-4.8 project, restart VS if necessary.
- Build the realm-dotnet-framework-4.8 project which should raise the errors mentioned above.
Version
11.4.0
What Atlas Services are you using?
Local Database only
What type of application is this?
Console/Server
Client OS and version
Windows 11 Enterprise
Code snippets
See https://github.com/crleblanc/realm-dotnet-interfaces
Stacktrace of the exception/crash you're getting
No response
Relevant log output
Build started... 1>------ Build started: Project: realm-dotnet-framework-4.8, Configuration: Debug Any CPU ------ 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'IRealmObjectBase.Accessor' 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'IRealmObjectBase.IsManaged' 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'IRealmObjectBase.IsValid' 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'IRealmObjectBase.IsFrozen' 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'IRealmObjectBase.Realm' 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'IRealmObjectBase.ObjectSchema' 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'IRealmObjectBase.DynamicApi' 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'IRealmObjectBase.BacklinksCount' 1>H:\realm-dotnet-interfaces\realm-dotnet-framework-4.8\Program.cs(13,53,13,65): error CS0535: 'ImplementsRealmInterface' does not implement interface member 'ISettableManagedAccessor.SetManagedAccessor(IRealmAccessor, IRealmObjectHelper?, bool, bool)' ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Build started at 5:04 PM and took 01.214 seconds ==========