I have two lists (Red and blue) on the same domain, but can only fetch list items from one of the lists. I can see item count, id etc. of both lists. My app has all rights to Sharepoint
This is my code
ClientContext clientContext = new AuthenticationManager().GetACSAppOnlyContext(siteUrl, clientID, clientSecret);
try
{
var oList = clientContext.Web.Lists.GetById(Guid.Parse("*ListGUID*"));
clientContext.Load(oList);
clientContext.ExecuteQuery();
ListItemCollection collListItem = oList.GetItems(CamlQuery.CreateAllItemsQuery());
clientContext.Load(collListItem);
clientContext.ExecuteQuery();
}
catch (Exception ex)
{
// Log or output the exception details
Console.WriteLine(ex.ToString());
}