Connect to sharepoint on premise site from my Asp,net

1.4k Views Asked by At

I'm trying to connect to SharePoint on-premise website using .NET Core, this website requires authentication I didn't find a way to connect to it most of the results on the net are related to SharePoint online.

1

There are 1 best solutions below

3
On

Each SP OnPrem version has a dedicated CSOM nuget which you may use to connect.

the connection and getting some data will look similar to this (I didn't check this code but more or less it should fallow this approach )


     using (ClientContext context = new ClientContext("URL"))
    {
       var web = context.Web;
       var list = web.Lists.GetByTitle("some list title");
       context.Load(list, includes => includes.Title);
       context.ExecuteQuery();
    // after this line the list will be initialized 
    }

hope this will be of any help