C# 诊断SecurityNegotiationException异常

C# 诊断SecurityNegotiationException异常,c#,wcf,C#,Wcf,打电话时: var client = new CommonClient() XElement exceptionDates = XElement .Parse(client.ExceptionDatesUpdateControl("status").OuterXml); 将引发以下错误: SecurityNegotiationException:调用SSPI失败 原因是什么 其他信息: Web.config: client.ExceptionDatesUpdateControl("st

打电话时:

var client = new CommonClient()
XElement exceptionDates = XElement
    .Parse(client.ExceptionDatesUpdateControl("status").OuterXml);
将引发以下错误:

SecurityNegotiationException:调用SSPI失败

原因是什么

其他信息:

Web.config:

client.ExceptionDatesUpdateControl("status")

App.config:

<system.serviceModel>
    <bindings>
      <netNamedPipeBinding>
        <binding name="NetNamedPipeBinding_ICommon" />
      </netNamedPipeBinding>
    </bindings>
    <client>      
      <endpoint address="net.pipe://localhost/service/common" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ICommon" contract="Service.Common.ICommon" name="NetNamedPipeBinding_ICommon">            
      </endpoint>
    </client>

在以下情况下可能发生此异常:

•谈判时 初始安全上下文。准确的误差取决于 使用的协商技术:简单且受保护的GSS-API 协商(SPNEGO)或TLSNEGO。有关更多信息,请参阅安全性 协议

•在初始安全会话的基础上建立安全会话 上下文

•在现有安全会话的密钥续订期间

安全协商错误可能作为Spnego/Sslnego的一部分发生 安全协议或作为SecureConversation协议的一部分

资料来源:

我找到了答案。
当我深入观察时,还有一个例外: “Security.Authentication.AuthenticationException”

当我在配置文件中注释这些行时,它消失了:


<services>
      <service name="PROJ.Service.CommonService" behaviorConfiguration="CommonServiceBehavior">
        <host>
          <baseAddresses>            
            <add baseAddress="net.pipe://localhost/service/common"/>
          </baseAddresses>
        </host>            
        <endpoint
             address="net.pipe://localhost/service/common"
             binding="netNamedPipeBinding"
             bindingConfiguration="pipeCommonServiceBinding"
             contract="PROJ.Service.ICommon"
             />
 <!--identity>
      <servicePrincipalName value="host/..." />
    </identity-->