Using CSOM to get data from SharePoint. After adding new fields to a list I get the "Value does not fall within expected range" error when trying to retrieve items from a list. I use the Include statement to include fields
Example
icon => icol.Include(
i => i["Field1"],
i => i["Field2"],
i => i["SomeNewField"])
When I add the SomeNewField I get the error. Thought it was about null values but even when I add a record where SomeNewField has a value the error occurs.
Any ideas
Thanks a lot you've solved my problem. The funny thing is that if you don't add any viewfields at all it will work. If you add some view fields you have to add them all. I have a lot of queries where I don't have defined the ViewFields and it works.
This should be by design. You could accept my reply as answer and upvote it.Thank you.
Sorry Amos are not allowed to upvote. How do I accept, do not use stack overflow a lot, so I'm not an expert 😂