Subclass with no additional properties from base class will trigger System.ArgumentOutOfRangeException

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.4.1
    • Component/s: Serialization
    • Environment:
      .Net 4.5
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      See:
      MongoDB.Bson.Tests.Serialization.Conventions.ImmutableTypeClassMapConventionTests

      Using test class:
      private class TestClassD : TestClassC
      {
      public TestClassD(string a, string b) : base(a, b) { }
      }

      Will result in:
      System.ArgumentOutOfRangeException
      The memberInfo argument must be for class TestClassD, but was for class TestClassC.
      Parameter name: memberInfo

      when making the following call:
      var classMap = BsonClassMap.LookupClassMap(typeof(TestClassD));

            Assignee:
            James Kovacs
            Reporter:
            sflorisson
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: