1

我在帐户实体上创建了一个简单的创建后插件,使SharePoint中的子网站与创建的帐户名称相同。Dynamics CRM 2016在线安全性/隔离模式

我已使用Microsoft.SharePoint.Client.Runtime程序集中的SharePointOnlineCredentials类登录到SharePoint实例。

只要插件设置为isolation mode = none,该插件就可以在内部部署实例上工作。

当我在Sandbox隔离模式下运行插件时,出现下面的错误(在线版本错误)。

我想在SharePoint的在线实例上运行此插件,但是我相信我无法使用隔离模式= none在线运行,是否有另一种在联机CRM实例上使用此SharePoint程序集运行代码的方式?

消息:创建,方法:ExecutePluginLogic异常: System.Security.SecurityException:请求类型的许可 “System.Security.Permissions.SecurityPermission,mscorlib程序, 版本= 4.0.0.0,文化=中性,PublicKeyToken = b77a5c561934e089' 失败。在System.Security.CodeAccessSecurityEngine.Check(对象 需求,StackCrawlMark & stackMark,布尔isPermSet)在 System.Security.CodeAccessPermission.Demand()在 System.Net.AuthenticationManager.Register(IAuthenticationModule authenticationModule)在

Microsoft.SharePoint.Client.SharePointOnlineAuthenticationModule.EnsureRegistered() 在 Microsoft.SharePoint.Client.SharePointOnlineCredentials..ctor在

MWLSPXRMToolkitOnline.Plugins.A(字符串 用户名,密码SecureString的) ccountCreate.ExecutePluginLogic(IServiceProvider的 的ServiceProvider)在 MWLSPXRMToolkitOnline.Plugins.BasePlugin.Execute(IServiceProvider的 的ServiceProvider)

失败了行动:需求 第一许可失败的类型是:

系统。该 组件失败的Security.Permissions.SecurityPermission区域是:我的电脑

回答

1

不理智,在沙盒模式下运行时,你可以不包括对引用其他组件。你可以尝试使用ILMerge将这些程序集合在一起,但是如果我是你,我会采取不同的方法,例如将工作推向外部Web服务。

+0

谢谢你的提醒。我将采用您建议的外部Web服务方法。 – flowagss

0

如果使用ILMerge的组件结合在一起(如建议由詹姆斯·伍德因为在沙盒模式下运行时,你可以不包括引用),请使用ILMerge的“/ copyattrs”参数。 如果你已经在NuGet包项目安装ilMarge:

编辑在溶液中的文件:ILMerge.props 更改参数:

<ILMergeAllowMultipleAssemblyLevelAttributes>true</ILMergeAllowMultipleAssemblyLevelAttributes> 
<ILMergeCopyAttributes>true</ILMergeCopyAttributes> 
相关问题