无法识别的元素“extendedProtectionPolicy”

来源:互联网 发布:pdf修改文字软件 编辑:程序博客网 时间:2024/05/10 15:58
无法识别的元素“extendedProtectionPolicy”
2010-07-28 15:42

在Windows7下建立的一个项目,在XP中打开后,更新WCF服务时爆出了错误:无法识别的元素“extendedProtectionPolicy”。通过网上搜索,错误原因如下:

当在 Windows 7 上用 VS2008 开发 WCF 3.5 客户端程序时,VS 将在自动生成的配置文件的 ***Binding/security/transport 节中插入

<extendedProtectionPolicy policyEnforcement="Never" />

如果将此程序在其他操作系统上启动时将报错:无法识别的元素“extendedProtectionPolicy” (Unrecognized element extendedProtectionPolicy)。

解决方法为:直接删除此节点。

网上找到的其它信息:

这是一个已知的问题,仅存在 Windows 7 系统上,似乎 Windows 7 对 .NET 3.5 的特殊扩展,但其他早期版本操作系统又不支持,下面是来自 WCF Team 的解释:

Thank you for contacting us with your question.
Windows 7 has an additional security feature called Extended Protection. When you create an app.config for a client from the Windows 7 service, the tag "extendedProtectionPolicy" will be present in the app.config. When deploying the client to versions of Windows prior to Windows 7, this tag will not be valid. This is a known issue. This tag is not actually used by the client, so simply remove the tag. We will try to update future versions of .Net 3.5 to not include this tag in the generated app.config.
Thanks,
WCF Team