I am trying to access the items of a list that crossed the 5000 limit through C# CSOM. But the list throws an exception as:

The attempted operation is prohibited as the list crossed the threshold limit.

This is the code I'm using. How do I have to modify it, to retrieve the items?

string siteUrl = "URL of site";
ClientContext SourceclientContext = new ClientContext(siteUrl);
List Sourcelist = SourceclientContext.Web.Lists.GetByTitle("List Title");
CamlQuery query = new CamlQuery();query.ViewXml = "<View/>";
ListItemCollection listItemCollection = Sourcelist.GetItems(query);
  • social.technet.microsoft.com/Forums/office/en-US/… check this link,. try this solution :camlQuery.ViewXml = @"<View Scope='RecursiveAll'><Query><OrderBy Override='TRUE'><FieldRef Name='ID' Ascending='True'/></OrderBy></Query> <ViewFields> <FieldRef Name='ID'/> </ViewFields> <RowLimit Paged='True'>10</RowLimit> </View>";
    – samolpp2
    Feb 17, 2016 at 10:56

2 Answers 2


Don't raise the list view threshold (LVT) to something greater than 5000 (default), as it does not address the real issue. You'd just end up raising it more and more as your list(s) grow and end up causing performance issues.

Instead, use the ListItemCollectionPosition of a CAML query to get all of the list items without running into an error. Use this link and look at the MSDN-provided example. Change the RowLimit (example has it set to 2) to something like 1000 as that will determine the batch size for selecting list items from your list.


First step should be to be create indexes for the concerned List/library by going in List Settings and Create Index. Even after that the issue persists, use ListItemCollectionPosition object to handle large lists. check this https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.listitemcollectionposition.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.