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

Enumerations cannot be serialized when part of a dictionary

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.11
    • Affects Version/s: 1.0
    • Component/s: None
    • None

      This occurs on the latest git source as of today (8d1d29365ebefea40d2c).

      [Test]
      public void Test()
      {
      var table = new Hashtable();
      table["Text"] = "hello";
      table["Enum"] = E.B;
      new Doc

      { Values = table }

      .ToBson();
      }

      The above test will fail with a MongoDB.Bson.BsonSerializationException : EnumSerializer cannot be used with type: System.Object.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            bling Bailey Ling
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: