You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: Serializing an object which has not an absolute URI, just a relative. Exception thrown: System.InvalidOperationException: 'This operation is not supported for a relative URI.'
Source of the Problem: LiteDB/Client/Mapper/BsonMapper.cs::128
Original: RegisterType<Uri>(uri => uri.AbsoluteUri, bson => new Uri(bson.AsString));
correct Version should be: RegisterType<Uri>(uri => uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.ToString(), bson => new Uri(bson.AsString));
Workaround:
manually register the custom mapper like: BsonMapper.Global.RegisterType<Uri>(uri => uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.ToString(), bson => new Uri(bson.AsString));
The text was updated successfully, but these errors were encountered:
Problem: Serializing an object which has not an absolute URI, just a relative.
Exception thrown: System.InvalidOperationException: 'This operation is not supported for a relative URI.'
Source of the Problem:
LiteDB/Client/Mapper/BsonMapper.cs::128
Original:
RegisterType<Uri>(uri => uri.AbsoluteUri, bson => new Uri(bson.AsString));
correct Version should be:
RegisterType<Uri>(uri => uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.ToString(), bson => new Uri(bson.AsString));
Workaround:
manually register the custom mapper like:
BsonMapper.Global.RegisterType<Uri>(uri => uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.ToString(), bson => new Uri(bson.AsString));
The text was updated successfully, but these errors were encountered: