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

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

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

      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@mongodb.com James Kovacs
            Reporter:
            sflorisson sflorisson
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: