Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1255

An ignored BsonElement with a prefix of a known BsonElement's causes an EndOfStreamException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1, 2.1
    • Component/s: Serialization
    • Labels:
      None
    • Environment:
      MongoDB C# Legacy Driver version 2.0
    • Sprint:
      C# Sprint 19

      Description

      This occurs when a class map is being deserialized which includes a non-mapped element which is the prefix of a mapped element. For example, given the class map:

      [BsonIgnoreExtraElements]
      public class Test
      {
      	public int Longer { get; set; }
      }
      

      Attempting to deserialize the document:

      { Long: 20 }
      

      will result in an EndOfStreamException.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              craiggwilson Craig Wilson
              Reporter:
              pgordon@truckdown.com Peter Gordon
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: