-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Serialization
-
None
-
Fully Compatible
-
Not Needed
-
dynamic doc = BsonSerializer.Deserialize<object>("{ Amount: NumberDecimal('42.42') }");
Console.WriteLine(doc.Amount);
Stack Trace:
Unhandled exception. MongoDB.Bson.BsonInternalException: Invalid BsonType. at MongoDB.Bson.IO.JsonReader.SkipValue() in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/src/MongoDB.Bson/IO/JsonReader.cs:line 869 at MongoDB.Bson.IO.IBsonReaderExtensions.FindElement(IBsonReader reader, String name) in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/src/MongoDB.Bson/IO/IBsonReaderExtensions.cs:line 40 at MongoDB.Bson.Serialization.Conventions.ObjectDiscriminatorConvention.GetActualType(IBsonReader bsonReader, Type nominalType) in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/src/MongoDB.Bson/Serialization/Conventions/ObjectDiscriminatorConvention.cs:line 119 at MongoDB.Bson.Serialization.Serializers.ObjectSerializer.DeserializeDiscriminatedValue(BsonDeserializationContext context, BsonDeserializationArgs args) in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/src/MongoDB.Bson/Serialization/Serializers/ObjectSerializer.cs:line 349 at MongoDB.Bson.Serialization.Serializers.ObjectSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args) in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/src/MongoDB.Bson/Serialization/Serializers/ObjectSerializer.cs:line 193 at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize[TValue](IBsonSerializer`1 serializer, BsonDeserializationContext context) in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/src/MongoDB.Bson/Serialization/IBsonSerializerExtensions.cs:line 49 at MongoDB.Bson.Serialization.BsonSerializer.Deserialize[TNominalType](IBsonReader bsonReader, Action`1 configurator) in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/src/MongoDB.Bson/Serialization/BsonSerializer.cs:line 118 at MongoDB.Bson.Serialization.BsonSerializer.Deserialize[TNominalType](String json, Action`1 configurator) in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/src/MongoDB.Bson/Serialization/BsonSerializer.cs:line 163 at Program.<Main>$(String[] args) in /Users/james/Dropbox/code/mongodb/mongo-csharp-driver/tests/MongoDB.Driver.TestConsoleApplication/Program.cs:line 9
- is related to
-
CSHARP-4648 Standardize handling of decimal vs Decimal128
- Closed