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.
Asked
Active
Viewed 1,163 times
1
-
Try to use Microsoft.SharePointOnline.CSOM 16.1.20211.12000 or the latest version. Accoring to [this link](https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/16585795-support-net-core-with-csom) and [this blog](https://developer.microsoft.com/en-us/microsoft-365/blogs/net-standard-version-of-sharepoint-online-csom-apis/), from the version 16.1.20211.12000 onwards, the CSOM package support .net core. – Zhi Lv Apr 19 '21 at 08:55
-
@ZhiLv it supports SharePoint online not on-premise – someone Apr 19 '21 at 11:37
1 Answers
0
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

Adam
- 810
- 7
- 10
-
-
TBH I am not sure but I would suspect that it is .NET Framework. The core is more used in SP Online and there is a really cool nuget for it as well here -> https://pnp.github.io/pnpcore/using-the-sdk/readme.html – Adam Nov 13 '21 at 14:19
-
Yes, but I am looking for .net core on-prem model. Guess I should implement it by myself? – Vladimir Titkov Nov 15 '21 at 06:04