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

No property name given in the error message in the case of a "half matching" variable name

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Security
    • Environment:
      Windows

      MongoDB C# Driver Exception:

      Message=Element '' does not match any field or property of class

      The problem was a typo with a property called RequiresAuthenticationFlag instead of RequiresAuthentication.

      I do not understand why the driver did not include the name of the variable inside the exception.

      Why does the driver not include the element name inside the exception?

      When I remove some characters of the DB variable's name, it does not throw a meaningful exception.

      DB Property Name: Requires
      Class Property Name: RequiresAuthentication

      Exception does not contain correct field name.

      When it is the other way around. It does contain a full name!

      (Class contains Requires and DB RequiresAuthentication)

      I think that must be a bug in the exception handling?

      (I have posted a question on Stackoverflow too and did not get an answer)

      Could you help me? Can you reproduce this? I am working on a Windows Server 2012 with the C# Driver and Visual Studio 2015.

            Assignee:
            Unassigned Unassigned
            Reporter:
            Matthias Matthias Jost [X]
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: