Share via

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 !

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows

Answer accepted by question author

RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
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.


Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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