我正在尝试从CRM 2013 Online中的沙盒插件中连接到SharePoint 2013 Online(使用CSOM)。为此,我将SharePoint Client和Client.Runtime DLL与ilmerge.exe合并到我的插件DLL中。但是只要下面的代码:
_context = new ClientContext(spSiteUrl)
{
Credentials = new SharePointOnlineCredentials(username, securePassword)
};
尝试创建SharepointOnlineCredentials
因为Sandbox限制而引发异常:
System.Security.SecurityException: Request for the permission of type ‘System.Security.Permissions.RegistryPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed.
是否有人解决了此问题,或者是否有其他选项可供CSOM使用SharePoint 2013 Online进行身份验证?