2010-12-22 106 views
1

當站點部署在服務器上但在我的開發箱上正常工作時出現此錯誤。將ASP.NET站點升級到.NET 4後SSPI協商失敗錯誤4

讓我提供一些關於如何設置一切的快速背景。

應用程序(WebApp)部署到運行IIS 7.0的Windows Server 2008 SP2。網站中有兩個應用程序:WebAppWebService。服務器不是域的一部分,但位於本地網絡中。

WebService包含WCF Web服務(svc)並且未被修改。我可以連接到這個並按預期使用它。

我將WebApp升級到ASP.NET 3.5 sp1,它具有WCF web服務的客戶端代理(通過添加服務引用生成)。升級之前一切正常。升級後,我可以運行它,並從我的開發盒(在域中)正確使用它,並且可以按預期使用WebService。當我在現場部署到服務器和訪問它,我得到以下錯誤(與堆棧跟蹤更新,只包括每個消息後的第一行):

[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 

我在IIS中所做的唯一變化將應用程序池設置爲.NET 4.

我已經測試過並可以從非域計算機連接並使用WebService,沒有任何問題。它可以從我的開發箱(在域中)正常工作。

我正在使用wsHttpBinding並使用本地(到服務器)Windows用戶帳戶的用戶名/密碼進行身份驗證。我在客戶端代理的ClientCredentials.Windows.ClientCredential屬性上設置了用戶/密碼。

這裏是客戶端綁定在我的安全配置(這是所有自動根,我不是從添加服務引用修改):

<security mode="Message"> 
    <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/> 
    <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/> 
</security> 

再次,一切工作正常,如果asp.net網站是從服務器以外的地方運行的。

我會很感激任何建議。謝謝!

+0

什麼是內部異常?堆棧跟蹤? – 2010-12-22 09:36:30

回答

1

嘗試重新安裝.net4分發文件。 有時候,當你啓用一些.net3.5功能時會造成奇怪的問題。