-
Type:
Improvement
-
Resolution: Duplicate
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.4.3
-
Component/s: Serialization
-
None
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
The untyped overloads of RegisterSerializer can't catch type mismatches at compile time. They are currently not being caught at runtime either, and mismatches result in difficult to diagnose errors later on when the driver attempts to use the mismatched serializer.
For example, the following should be a runtime error:
var xserializer = new XSerializer(); BsonSerializer.RegisterSerializer(typeof(Y), xserializer);
- duplicates
-
CSHARP-2150 RegisterSerializer should check that the serializer's ValueType matches the type it is being registered for
-
- Backlog
-
- related to
-
CSHARP-1948 LINQ translation error when RegisterSerializer was called with a serializer for the wrong value type
-
- Closed
-