Deserializing an object array containing int32s fails with a FileFormatException

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 1.0
    • Affects Version/s: 0.11
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Exception stack trace is http://pastebin.com/DFAz5eE4
      Sample code is
      namespace ConsoleApplication
      {
      class Program
      {
      public class B
      {
      [BsonId]
      public ObjectId Id

      { get; set; }
      public int GetMe { get; set; }


      public object[] Items

      { get; set; }


      }
      static void Main(string[] args)

      { var server = MongoServer.Create("mongodb://localhost/?safe=true"); var database = server["onlinetests"]; var bcoll = database.GetCollection<B>("btest2"); var bee = new B(); bee.GetMe = 1; bee.Items = new object[1]; bee.Items[0] = 123; bcoll.Insert(bee); var bsonValue = new BsonInt32(bee.GetMe); // throws on deserialization var test = bcoll.FindOne(MongoDB.Driver.Builders.Query.EQ("GetMe", bsonValue)); }

      }
      }

            Assignee:
            Robert Stam
            Reporter:
            Sridhar Nanjundeswaran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: