【发布时间】: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