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

症状

依赖 WPProperty 的 Web 部件无法再正常工作,并在 SharePoint 统一日志记录系统 (ULS) 中生成 a7wm1 事件标记。

原因

发生此问题的原因是 SharePoint Server 现在要求服务器场声明允许访问 web.config 文件中的 WPProperty 的 .NET 类型。 作为安全预防措施,未列出的 .NET 类型无法访问 WPProperty

解决方法

若要解决此问题,请安装下列任一更新:

若要使 Web 部件按预期工作,请执行以下步骤,声明允许受影响的 .NET 类型访问 web.config 文件中的 WPProperty

重要: 仅当确认安全后,方可允许 .NET 类型访问 WPProperty

  1. 打开 SharePoint 服务器场中每个服务器上 Web 应用程序的 web.config 文件。

  2. 找到 configuration/SharePoint/SafeMode 部分。

  3. 添加 AllowedWPProperties 部分(如果不存在)。

  4. 添加具有 typepropertyName 属性的 AllowedWPProperty 元素,以表示允许该类型访问 WPProperty

    <SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="15" TotalFileDependencies="250" AllowPageLevelTrace="false">
        <AllowedWPProperties>
            <AllowedWPProperty type="<allowedWPPropertyTypeName>,<allowedWPPropertyAssemblyName>, <AssemblyVersion>, <AssemblyLanguageSetting>, <AssemblyPublicKey>" propertyName="<Allow WPProperty property name>"/>
        </AllowedWPProperties>
    </SafeMode>

  5. 将更改保存到 web.config 文件。

若要识别 typepropertyName 属性的正确值,请查询 ULS 日志以找到 a7wm1 事件标记,并记下日志项目。 例如:
 
"WPProperty has been blocked for security reason. blocked AssemblyQualifiedName is "<BlockedWPPropertyTypeName>, <allowedWPPropertyAssemblyName>, <AssemblyVersion>, <AssemblyLanguageSetting>, <AssemblyPublicKey>" | blocked property name is "<blocked WPProperty name>",
 
若要允许此类型访问 WPProperty,将 AllowedWPPProperty type 属性设置为阻止的 AssemblyQualifiedName 值,将 propertyName 属性设置为阻止的属性名称值。

更改历史记录

 下表汇总了本主题的一些最重要的更改。

日期

说明

2021 年 9 月 14 日

在“解决方法”部分添加了两个更新。

需要更多帮助?

需要更多选项?

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

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

此信息是否有帮助?

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

谢谢您的反馈!

×