Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将ASP.NET站点升级到.NET 4后,SSPI协商失败错误_C#_Asp.net_Wcf_Iis 7_Wcf Security - Fatal编程技术网

C# 将ASP.NET站点升级到.NET 4后,SSPI协商失败错误

C# 将ASP.NET站点升级到.NET 4后,SSPI协商失败错误,c#,asp.net,wcf,iis-7,wcf-security,C#,Asp.net,Wcf,Iis 7,Wcf Security,当站点部署在服务器上,但在my dev box上正常工作时,会出现此错误 让我提供一些关于如何设置一切的快速背景 应用程序(WebApp)已部署到运行IIS 7.0的Windows Server 2008 SP2。网站中有两个应用程序:WebApp和WebService。服务器不是域的一部分,但位于本地网络上 Web服务包含WCF Web服务(svc),尚未修改。我可以连接到这个并按预期使用它 我将WebApp从ASP.NET 3.5 sp1升级到ASP.NET 4,它有一个到WCF webse

当站点部署在服务器上,但在my dev box上正常工作时,会出现此错误

让我提供一些关于如何设置一切的快速背景

应用程序(WebApp)已部署到运行IIS 7.0的Windows Server 2008 SP2。网站中有两个应用程序:WebAppWebService。服务器不是域的一部分,但位于本地网络上

Web服务包含WCF Web服务(svc),尚未修改。我可以连接到这个并按预期使用它

我将WebApp从ASP.NET 3.5 sp1升级到ASP.NET 4,它有一个到WCF webservice的客户端代理(通过添加服务引用生成)。在升级之前,一切都正常工作。升级后,我可以从我的开发框(在域上)运行并正确使用它,并且它可以按预期使用WebService。当我将站点部署到服务器并访问它时,会出现以下错误(使用堆栈跟踪更新,仅包括每条消息后的第一行):

我在IIS中所做的唯一更改是将应用程序池设置为.NET 4

我已经测试过,可以从非域计算机连接并使用Web服务,没有任何问题。它可以在我的开发盒(域上)中正常工作

我正在使用wsHttpBinding并使用本地(服务器)windows用户帐户的用户名/密码进行身份验证。我在客户端代理的ClientCredentials.Windows.ClientCredential属性上设置了用户/密码

这是我在客户端绑定下的安全配置(它都是自动生成的,我没有通过添加服务引用来修改它):


同样,如果asp.net站点不是从服务器上运行的,则一切正常


如果有任何建议,我将不胜感激。谢谢

尝试重新安装.net4分发文件。
有时,启用某些.net3.5功能会导致奇怪的问题。

尝试重新安装.net4分发文件。
有时,当您启用某些.net3.5功能时,会导致奇怪的问题。

内部异常是什么?堆栈跟踪?我已经在堆栈跟踪中添加了所有消息。您可以将RDP添加到服务器中吗?如果是这样,您可以在浏览器中打开服务的URL吗?它是否会提示您输入凭据?我已输入RDP,但它不会提示我输入任何凭据。内部异常是什么?堆栈跟踪?我已经在堆栈跟踪中添加了所有消息。您可以将RDP添加到服务器中吗?如果是这样,您可以在浏览器中打开服务的URL吗?它是否会提示您输入凭据?我已输入RDP,但它不会提示我输入任何凭据。
[Win32Exception (0x80004005): The Security Support Provider Interface (SSPI) negotiation failed.]
System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob, ChannelBinding channelbinding, ExtendedProtectionPolicy protectionPolicy) +3705927

[SecurityNegotiationException: SOAP security negotiation with 'http://server.mydoamin.com/WebService/TestService.svc' for target 'http://server.mydoamin.com/WebService/TestService.svc' failed. See inner exception for more details.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +9464367

[HttpException (0x80004005): SOAP security negotiation with 'http://server.mydoamin.com/WebService/TestService.svc' for target 'http://server.mydoamin.com/WebService/TestService.svc' failed. See inner exception for more details.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9028953

[HttpException (0x80004005): SOAP security negotiation with 'http://server.mydoamin.com/WebService/TestService.svc' for target 'http://server.mydoamin.com/WebService/TestService.svc' failed. See inner exception for more details.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8950644
<security mode="Message">
  <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
  <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
</security>