Getting 'Unknown error' while loading 'User information list' items in SharePoint CSOM

Yuvraj Patil 441 Reputation points
2022-06-15T12:17:41.34+00:00

Getting below exception while loading the 'User Information List' items.

Microsoft.SharePoint.Client.ServerException: Unknown Error
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

211703-image.png

@RaytheonXie_MSFT

Code I am trying:

ListItemCollection listItemCollection;  
var list = web.Lists.GetByTitle("User Information List");  
clientcontext.ExecuteQuery();  
  
// Load the items and folders.  
CamlQuery camlQuery = new CamlQuery();  
camlQuery.ViewXml = "<View Scope=\"RecursiveAll\"></View>";  
  
listItemCollection = list.GetItems(camlQuery);  
clientcontext.Load(listItemCollection);  
clientcontext.ExecuteQuery();  

Please help, Thanks in advance !

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,069 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,201 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
617 questions
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 37,866 Reputation points Microsoft Vendor
    2022-06-16T06:39:09.17+00:00

    Hi @Yuvraj Patil ,
    Your caml query is incorrect, I have tested following code and it works. Please make a reference.

    ListItemCollection listItemCollection;  
    var list = web.Lists.GetByTitle("User Information List");  
    ctx.ExecuteQuery();  
      
    // Load the items and folders.  
    CamlQuery camlQuery = new CamlQuery();  
    camlQuery.ViewXml = "<View Scope=\'RecursiveAll\'><Query></Query></View>";  
      
    listItemCollection = list.GetItems(camlQuery);           
    ctx.Load(listItemCollection);  
    ctx.ExecuteQuery();  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.