Always use Microsoft Graph APIs when possible, but if you need to use capabilities which are not yet exposed within the Microsoft Graph, you might need to fall back on the SharePoint Online CSOM APIs. Today we are thrilled to announce availability of a new version of the SharePoint Online CSOM NuGet package, which also includes .NET Standard versions of the CSOM APIs.
This enables you to take advantage of the SharePoint CSOM API surface within your .NET Core based solutions, which unblocks you to use the latest versions of the Microsoft Azure services. As an example, you can use this version of CSOM in the latest runtime of Azure Functions to automate your business operations.
.NET Standard version of the CSOM Assemblies are included on the existing NuGet package called Microsoft.SharePointOnline.CSOM from the version 16.1.20211.12000 onwards. You can expect .NET Standard version to be included also in the upcoming monthly release.
Please use the following resource to get you you started on using .NET Standard version of the SharePoint Online CSOM APIs.
- Using CSOM for .NET Standard instead of CSOM for .NET Framework – docs.microsoft.com
- Preview on upcoming SharePoint Online CSOM .NET Standard Version – M365 PnP YouTube channel
Why were these APIs not provided through the Microsoft Graph API surface?
We are highly committed on providing new APIs for the Microsoft Graph APIs, but as we also already had the existing CSOM API surface, we wanted to ensure that our customers and partners can take advantage of the latest techniques in the cloud with the existing API set. We will keep on improving the Microsoft Graph API surface also in future, from which the upcoming Microsoft Graph taxonomy and content type APIs is a great example. We will keep on supporting the CSOM API surface as well as it’s the underlaying API setup for example for the SharePoint Online management PowerShell cmdlets, but you can expect more and more focus on the Microsoft Graph side in future.
Why where these only provided for the SharePoint Online and not also for SharePoint on-premises version?
This was an unfortunate decision related on the complexity of the CSOM APIs. CSOM APIs are not just client-side APIs, but they also have a direct dependency on the server side API surface. As Microsoft controls the backend of SharePoint Online, we could roll out the needed changes to ensure that the APIs work properly for all of our tenants. Performing the same actions for on-premises would require significant updates on the server side surface, which are not unfortunately in the plans for SharePoint 2016 or SharePoint 2019 versions.
I would need this also for on-premises, how would I request that?
Best way to ensure that the demand for on-premises specific requirements is required, is to provide votes on following UserVoice entry in the SharePoint UserVoice – Support SharePoint 2016/2019 with .NET Standard APIs.
Will you keep on investing on the CSOM API surface
Microsoft Graph is our primary priority, but you can expect to see some administrative API changes also for the CSOM APIs. We will continue releasing monthly releases of the CSOM NuGet package for now and we’ll call out the updated API surface with blog posts, when there are meaningful changes on the package.
I’m a big fan of the PnP Sites Core and PnP PowerShell, will they be updated soon to use this version of CSOM?
PnP Sites Core extends the native API surface and will be released also as a .NET Standard version soon. PnP PowerShell will be also updated to the use newer version of the PowerShell, now that the underlaying API surface is no longer blocking that. These updates are expected to happen within upcoming months. We will share details on the progress and next steps in our upcoming community calls.
What is the exact .NET Standard version of these APIs?
New assemblies are using .NET Standard version 2.0. See more details on NET implementation support from the .NET Standard official documentation.
“Sharing is caring”
SharePoint Team, Microsoft – 23rd of June 2020