【问题标题】:Querying on premises SharePoint 2013 with UWP app使用 UWP 应用程序查询本地 SharePoint 2013
【发布时间】:2018-02-08 14:00:55
【问题描述】:

我正在尝试编写一个应用程序,使我们的用户能够查询 Sharepoint 并返回一个文档。我正在尝试使用 UWP 应用执行此操作。

我一直在阅读这方面的内容,似乎有很多方法可以做到这一点,但由于它是一个 UWP 应用程序,所以我一无所获。

我刚刚尝试将 dll Microsoft.SharePoint 从 SharePoint 服务器导入到我的应用程序中,一切正常。我可以在应用程序中引用它而不会出错。这是一些测试代码,显然不能正常工作,但我想确保 SPSite 已正确解析。

using Microsoft.SharePoint;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AssetTags
{
    class SPQuery
    {

        private string SPURL;

        public string getSPDocPath()
        {
            SPSite sp = new SPSite(SPURL);

            return "";
        }

    }
}

然后我调试了该应用程序,但它无法运行。它由MainPage.xaml 上的一个按钮组成,作为测试。我得到了错误 -

严重性代码描述项目文件行抑制状态 错误在模块中找不到类型 System.ApplicationException CommonLanguageRuntime 库。资产标签

经过进一步的谷歌搜索后,我发现了这个问题 - Stackoverflow Question,其中指出:

根据我的阅读,System.ApplicationException 在 .Net 中已贬值 对于 UWP,您应该只使用 System.Exception

所以我的问题是,是否有人有开发可以查询 SharePoint 2013 的本地安装的 Windows 10 UWP 应用程序的经验?如果是这样,您能否提供一些有关如何最好地开始的信息,因为我真的很挣扎。

【问题讨论】:

    标签: c# sharepoint uwp


    【解决方案1】:

    我不确定你从 SharePoint 服务器导入的 DLL 在 UWP 应用中是否受支持。

    但在 UWP 中,您可以使用 Microsoft Graph API。您可以看到 Microsoft Graph 中的SharePoint API 支持以下核心场景:

    1. 访问 SharePoint 网站、列表和驱动器(文档库)
    2. 对站点资源的只读支持(无法创建新站点)
    3. 对列表、listItems 和 driveItems 的读写支持
    4. 按 SharePoint ID、URL 或相对路径寻址资源

    详情请咨询Microsoft Graph Samples for UWP (REST)

    【讨论】:

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