How can I get a nuget package for `SPUtility` compatible with `Microsoft.SharePoint2013.CSOM`?

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/240341

  •  15-01-2021
  •  | 
  •  

Question

In CSOM, you could use SPUtility to get the members of a security group. see https://stackoverflow.com/questions/4314767/getting-members-of-an-ad-domain-group-using-sharepoint-api/6164703

I use the nuget package

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.SharePoint2013.CSOM" version="15.0.4711.1000" targetFramework="net45" />
</packages>

to do all of my CSOM work. But this is missing this utility package.

Am I missing an import? How can I get a compatible Nuget package with this SPUtility class? https://msdn.microsoft.com/library/Microsoft.SharePoint.Utilities.SPUtility.aspx

Was it helpful?

Solution

SPUtility is not available in the CSOM, and it never has been. The links you provided relate to the server object model. To have access to it you need to be on a machine with SharePoint installed and add a reference to SharePoint.dll.

Classes in the CSOM will have Microsoft.SharePoint.Client in their namespace.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top