PropertyChanged causes System.IO.FileLoadException

I am listening for Property changes in my Desktop Bridge .NET application like described here
Using the RealmChanged event works fine, however when adding a Propertychanged Event, or subscribing using the SubscribeForNotifications i get an exception thrown:

An unhandled exception of type 'System.IO.FileLoadException' occurred in Realm.dll
`Could not load file or assembly "System.Runtime.CompilerServices.Unsafe`

The object and query i am calling the events from are fine, what is causing this? Havent found anything similar on the forums yet


Is there a test project that you could send us to investigate what’s happening?

I was able to track this problem down.
When using an encryptionkey in a PartitionSyncConfiguration this exception is thrown, when adding an PropertyChanged event. I am going to implement my own encryption.

var  writeConfig = new PartitionSyncConfiguration(writePartition, RealmApp.CurrentUser);
//remove encryptionkey to fix
writeConfig.EncryptionKey = key;

I’m glad to hear that you could figure your issue out. However, we’d still like to have a look at this specific use case. Would you mind sending a minimal repro case? We’d really appreciate.


1 Like