如何为 SharePoint Online 设置 .NET 开发环境
How to set up a .NET development environment for SharePoint Online
我们需要将一些内容从多个本地系统迁移到 SharePoint Online。
我想使用 C#.NET,因为理想情况下,我们将能够重用为本地 SharePoint 编写的代码。
我过去使用的本地 SharePoint 代码使用如下引用:
<Reference Include="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
<Reference Include="Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
<Reference Include="Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
并像这样连接到 SharePoint:
// Connect to SharePoint
SPSite site = new SPSite("http://SiteURL/");
SPWeb web = site.OpenWeb();
// Connect to lists
foreach (SPList l in web.Lists)
...
我们不再有本地 SharePoint。
我们需要在开发机器上安装什么才能使用我们的代码在线访问 SharePoint?
SharePoint Online 不公开服务器端 SDK (SSOM),因此您不能使用以上代码或参考 Microsoft.SharePoint
。 SPO 连接的可用选项是:
- CSOM
- JSOM
- 休息API
更多参考资料:
- https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/complete-basic-operations-using-sharepoint-client-library-code#basic-operations-with-the-sharepoint-net-client-object-model
- https://www.codesharepoint.com/sharepoint-tutorial/connect-to-sharepoint-online-on-premise-and-extranet-using-csom
BR
我们需要将一些内容从多个本地系统迁移到 SharePoint Online。
我想使用 C#.NET,因为理想情况下,我们将能够重用为本地 SharePoint 编写的代码。
我过去使用的本地 SharePoint 代码使用如下引用:
<Reference Include="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
<Reference Include="Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
<Reference Include="Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
并像这样连接到 SharePoint:
// Connect to SharePoint
SPSite site = new SPSite("http://SiteURL/");
SPWeb web = site.OpenWeb();
// Connect to lists
foreach (SPList l in web.Lists)
...
我们不再有本地 SharePoint。
我们需要在开发机器上安装什么才能使用我们的代码在线访问 SharePoint?
SharePoint Online 不公开服务器端 SDK (SSOM),因此您不能使用以上代码或参考 Microsoft.SharePoint
。 SPO 连接的可用选项是:
- CSOM
- JSOM
- 休息API
更多参考资料:
- https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/complete-basic-operations-using-sharepoint-client-library-code#basic-operations-with-the-sharepoint-net-client-object-model
- https://www.codesharepoint.com/sharepoint-tutorial/connect-to-sharepoint-online-on-premise-and-extranet-using-csom
BR