How to Read a SharePoint List Using .NET 8?

Artillis Prado 0 Reputation points
2024-07-17T18:10:37.2833333+00:00

System.Net.WebException: 'The remote server returned an error: (403) FORBIDDEN.'
I am using .NET 8, and I've already tried with GetACSAppOnlyContext but it wouldn't work because I need to access more than 5 SharePoint sites simultaneously. There was an error in CC.ExecuteQuery();

    using (CC = authManager.GetWebLoginClientContext(siteUrl))
    {
        List list = CC.Web.Lists.GetByTitle("TT_002_Test");
        CamlQuery oQuery = CamlQuery.CreateAllItemsQuery();
        ListItemCollection oCollection = list.GetItems(oQuery);
        CC.Load(oCollection);
        CC.ExecuteQuery();
	}  

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,240 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,615 questions
{count} votes