I want to create item into SharePoint online list through .Net core console or Web API through CSOM, so is it possible? If yes then How?

Thanks in advance!


As of now, it's not possible to run a code with SharePoint CSOM under target framework equals to netcoreapp. However, you can create a .net core project (web app for example) and change TargetFramework to net471. All Microsoft related packages depend on .net standard, .net framework 4.7.* also depends on .net standard, that's why you can restore all dependencies successfully. The only obvious drawback is that you lose cross-platform feature and can't run your solution on linux. Yet you can use latest asp.net core version.

Recently I've created a sample SharePoint add-in solution, based on ASP.NET Core 2.1, it's available here - ASP.NET-Core-with-SharePoint-Add-in . Please read this my answer if you want to understand how to run this sample.

| improve this answer | |

For .NET Core project, SharePoint CSOM still not supported to build with it.

Support .NET Core with CSOM is Currently in Implementation. You can check the status of the User Voice using the Below link


Here is a nice workaround which will getting SharePoint CSOM run with .NET Core, I would suggest you can refer:


But it's not the official support way to run .NET Core Project with SharePoint CSOM

| improve this answer | |

I investigated the possibilities and created a short code snippet to use SharePoint REST APIs with .net core (i.e. Azure functons).

In a nutshell:

  • Register a SharePoint app with appregnew.aspx and grant it app-only permissions to the site / list you need.
  • Use bare OAuth2 to obtain an access token.
  • Then you can use the SharePoint REST APIs with HttpClient or any other standard C# way, using the access token.
  • You do not need any libraries or dependencies to use this method.

You can find the code and detailed solution description here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.