當我在Visual Studio中添加一個服務引用到一個服務時,它不斷添加這個extendedProtectionPolicy
到我的安全綁定,它在我的Win7機器上工作正常。但是當我部署到Server 2003時,它錯誤地指出配置文件中無法識別的元素。Visual Studio「添加服務引用」不斷添加「extendedProtectionPolicy」到我的配置文件
刪除行<extendedProtectionPolicy policyEnforcement="Never" />
修復了錯誤。
這是後產生不希望的web.config中的整個部分的添加服務引用(客戶端)
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
這是我的服務正在使用的行爲(IIS7主機側)
<behavior name="GetHttpsIncludeFaults">
<serviceCredentials>
<userNameAuthentication
userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="MyCustomValidator, MyOtherAssembly"/>
</serviceCredentials>
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
我想指出一些事情。這發生在VS2010和VS2008中。這發生在Consumer-Projects的ASP.NET-MVC風格AS和Windows Service/WPF應用程序中。
我想補充一點,該錯誤也適用於Windows Vista。 – 2010-07-14 16:37:52