【问题标题】:How to set up a .NET development environment for SharePoint Online如何为 SharePoint Online 设置 .NET 开发环境
【发布时间】:2020-09-29 11:20:48
【问题描述】:

我们需要将一些内容从多个本地系统迁移到 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?

【问题讨论】:

  • 它是相同的产品(或者足够接近,无论如何),只是在不同的 URL。您是否尝试过仅更改代码中的 URL 以指向您的在线版本?
  • 这本来可以尝试,但是不,我不能真正尝试它,因为我实际上没有引用的 DLL。

标签: c# sharepoint-online


【解决方案1】:

SharePoint Online 不公开服务器端 SDK (SSOM),因此您不能使用上述代码或引用 Microsoft.SharePoint。 SPO 连接的可用选项有:

  • CSOM
  • JSOM
  • 休息 API

更多参考资料:

BR

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多