找不到 Microsoft.SharePoint.Client.Sharing.SecurableObjectExten



我正在尝试调用Microsoft.SharePoint.Client.Sharing.SecurableObjectExtensions.GetSharingInformation((方法,该方法存在于Microsoft文档中的以下链接中:https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-csomspt/3b13bf76-d6ca-4918-b500-7585fecdf79b。

我安装了一些 sharepoint nuget 包,但在命名空间Microsoft.SharePoint.Client.Sharing中找不到类SecurableObjectExtensions。有人可以帮助我解决这个问题吗?

这是我的实际代码:

using System;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Sharing;
namespace Borrar
{
class Program
{
static void Main(string[] args)
{
ClientContext context = new ClientContext("https://<tenant>.sharepoint.com/sites/<site>")
{
Credentials = new SharePointOnlineCredentials("user@domain", securePassword),
};
context.Load(context.Web, w => w.Title);
context.ExecuteQuery();
List docList = context.Web.Lists.GetByTitle("Documents");
context.Load(docList);
// This creates a CamlQuery that has a RowLimit of 100, and also specifies Scope="RecursiveAll"
// so that it grabs all list items, regardless of the folder they are in.
CamlQuery query = CamlQuery.CreateAllItemsQuery(100);
ListItemCollection items = docList.GetItems(query);
// Retrieve all items in the ListItemCollection from List.GetItems(Query).
context.Load(items);
context.ExecuteQuery();
foreach (ListItem listItem in items)
{
//The problem is here
var sharingInfo = Microsoft.SharePoint.Client.Sharing.SecurableObjectExtensions.GetSharingInformation(listItem);
Console.WriteLine(sharingInfo);
}
}
}
}

这应该是 REST API

https://cann0nf0dder.wordpress.com/2018/04/04/externally-sharing-getsharinginformation-rest-api/

如前所述"协议服务器端点是通过将"_vti_bin/client.svc/ProcessQuery"附加到站点 (2( 的 URL 而形成的,"

https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-csomspt/1eb5bf91-ac5b-4fed-b75f-9d9d19a501e8

最新更新