ArgumentException: value cannot be null, parameter name : key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • msjonathan
    New Member
    • Dec 2009
    • 24

    ArgumentException: value cannot be null, parameter name : key

    Hej hej,

    I have a list of my own object PossibleField like this.

    Code:
    private List<PossibleField> PossibleFields {get; set; }
    Then I add some objects to the PossfibleFields with the .Add(....) function
    And if I do a count, all the object are in the list.
    Then I want tot do a foreach of all the possiblefield's .
    Code:
    foreach(PossibleField field in PossibleFields)
    {
    }
    But the compiler says the following: value cannot be null, parameter name: key.

    The same code worked before. Not only with the foreach, also with FirstOrDefault, Find, .... All the functions that retrieve something of the list.

    Does anybody has any idea? I'am willing to try everything :D
    Greetz,

    Jonathan
  • msjonathan
    New Member
    • Dec 2009
    • 24

    #2
    it was no problem at the list, it was the line above that caused the problem :D

    Greetz,

    Jonathan

    Comment

    Working...