使用 Microsoft 登录
登录或创建帐户。
你好,
使用其他帐户。
你有多个帐户
选择要登录的帐户。

症状

当您使用沙盒解决方案或 Web 部件时,您可能会在 SharePoint 统一记录系统 (ULS) 日志中收到类似于以下内容的错误消息。 这些消息表明某些沙盒解决方案或 Web 部件被阻止。

对于安装了 2022 年 5 月安全更新的 SharePoint Foundation 2013 和 SharePoint Enterprise Server 2016:

事件 ID

消息

ajrme

ExecuteRequestInSandBox 调用失败。 System.ArgumentException:在
Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.SPUserCodeSerializationBinder.BindToType(String assemblyName, String typeName)
无法解析类型 ……  

ajlz0

获取异常 System.ArgumentException 错误消息:在
Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.SPUserCodeSerializationBinder.BindToType(String assemblyName, String typeName)
无法解析类型 ……

对于安装了 2022 年 6 月安全更新或更高版本的安全更新的 SharePoint Foundation 2013,以及安装了 2022 年 7 月安全更新或更高版本的安全更新的 SharePoint Enterprise Server 2016:

事件 ID

消息

6k389

SPUserCodeSerializationBinder 中,无效类型:类型 = XXXXX;程序集 = YYYYY。 请访问 https://go.microsoft.com/fwlink/?LinkId=2196531 了解更多信息并了解如何解决此错误。

ajrme

ExecuteRequestInSandBox 调用失败。 System.ArgumentException:在
Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.SPUserCodeSerializationBinder.BindToType(String assemblyName, String typeName)
无法解析类型 ……

ajlz0

获取异常 System.ArgumentException 错误消息:在
Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.SPUserCodeSerializationBinder.BindToType(String assemblyName, String typeName)
无法解析类型 ……

原因

从 2022 年 5 月的安全更新开始,SharePoint 沙盒服务进一步限制了默认情况下允许运行的类型和程序集。 

解决方法 

要解决此问题,您必须注册 SharePoint 沙盒服务将允许运行的第三方类型或程序集。 为此,请按照下列步骤操作:

  1. 对于 SharePoint Foundation 2013,安装 2022 年 6 月的安全更新或更高版本的安全更新。 对于 SharePoint EnterpriseServer 2016,安装 2022 年 7 月的安全更新或更高版本的安全更新。 

  2. 使用受影响的沙盒解决方案或 Web 部件来触发问题。 

  3. 打开 SharePoint ULS 日志并查找事件 ID“6K389”。 您将找到带有该事件 ID 的以下消息: 

    SPUserCodeSerializationBinder 中,无效类型:类型 = XXXXX;程序集 = YYYYY。 请访问 https://go.microsoft.com/fwlink/?LinkId=2196531 了解更多信息并了解如何解决此错误。

  4. 注意被阻止的类型和程序集。 

  5. 打开沙盒解决方案或 Web 部件所在的 Web 应用程序的 web.config 文件。 web.config 的路径通常如下所示:

    C:\inetpub\wwwroot\wss\VirtualDirectories\<Web 应用程序端口>

  6. 在 configuration/SharePoint/SafeMode 部分添加 AllowedListItems 元素。  

  7. AllowedListItems 元素内,添加一个 AllowedItem 元素,并将 Name 属性设置为 AllowedSandboxType,格式如下:

  • 要取消阻止特定类型,请使用 Type 属性添加元素,如下所示:

    <AllowedItem Name="AllowedSandboxType" Type="XXXXX"/> 

  • 要取消阻止特定程序集,请使用 Assembly 属性添加元素,如下所示:

    <AllowedItem Name="AllowedSandboxType" Assembly="YYYYY"/>

下面是一个示例:

<SafeMode  

            MaxControls = "200"   

            CallStack = "false" 

            DirectFileDependencies ="10" 

            TotalFileDependencies = "250" 

            AllowPageLevelTrace = "false" 

            ControlCompatMode="false" 

            > 

            <PageParserPaths> 

            </PageParserPaths> 

         <AllowedListItems> 

     <AllowedItem Name="AllowedSandboxType" Type="Microsoft.SharePoint.Portal.WebControls.RSSAggregatorWebPart, Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=xxxxxx"/> 

             <AllowedItem Name="AllowedSandboxType" Assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxx"/> 

         </AllowedListItems> 

</SafeMode> 

需要更多帮助?

需要更多选项?

了解订阅权益、浏览培训课程、了解如何保护设备等。

社区可帮助你提出和回答问题、提供反馈,并听取经验丰富专家的意见。

此信息是否有帮助?

你对语言质量的满意程度如何?
哪些因素影响了你的体验?
按“提交”即表示你的反馈将用于改进 Microsoft 产品和服务。 你的 IT 管理员将能够收集此数据。 隐私声明。

谢谢您的反馈!

×