使用UWP应用程序查询SharePoint 2013

时间:2018-02-07 10:53:37

标签: c# sharepoint uwp

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

我一直在阅读这篇文章,似乎有很多方法可以做到这一点,但由于它是一个UWP应用程序,我无处可去。

我刚尝试将SharePoint服务器中的dll Microsoft.SharePoint导入到我的应用程序中,所有内容都显示正常。我可以在应用程序中引用它而不会出错。这是一些测试代码,显然不适合工作,但我想确保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

然后我调试了应用程序,它不会运行。它由<asp:UpdatePanel runat="server" ID="ViewAllRequestPanel"> <ContentTemplate> <div id="loader" class="loadingpanel"> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="ViewAllRequestPanel"> <ProgressTemplate> <image src="../../Images/Loading.gif" class="InProgressImg" /> </ProgressTemplate> </asp:UpdateProgress> </div> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdateInitiatorPanelsOnly="true"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="GridViewAllRequests"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="GridViewAllRequests" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> 上的一个按钮组成,作为测试。我收到了错误 -

  

严重级代码描述项目文件行抑制状态   错误在模块中找不到类型System.ApplicationException   CommonLanguageRuntimeLibrary。 AssetTags

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

  

从我读过的内容中,System.ApplicationException在.Net中被折旧   对于UWP而言,您应该只使用System.Exception

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

1 个答案:

答案 0 :(得分:1)

我不确定UWP应用程序是否支持从SharePoint服务器导入的DLL。

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

  1. 访问SharePoint网站,列表和驱动器(文档库)
  2. 对网站资源的只读支持(无法创建新网站)
  3. 对list,listItems和driveItems的读写支持
  4. 按SharePoint ID,URL或相对路径寻址资源
  5. 有关详细信息,请参阅Microsoft Graph Samples for UWP (REST)