2012-02-23 83 views
1

我正在將WCF服務從IIS 6.0移至Windows Server 2008 R2計算機上的IIS 7.5。當我瀏覽使用任何主流瀏覽器的服務,我得到以下錯誤:將WCF服務從IIS 6.0移至IIS 7.5

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

我檢查了服務器的事件日誌,並沒有看到任何看起來與衆不同。該服務的身份驗證設置設置爲匿名。我嘗試將服務的應用程序池管理流水線模式設置爲集成和經典,我仍然得到相同的結果。應用程序池的.NET框架是v2.0.50727。

這裏是服務的web.config文件中的system.serviceModel部分:

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="windowsBasicHttpBinding"> 
      <security mode="None"> 
      <transport clientCredentialType="None" /> 
     </security> 
     </binding> 
     <binding name="basicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" 
      receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" 
     bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferSize="65536" maxBufferPoolSize="524288" 
      maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8"  
      transferMode="Buffered" useDefaultWebProxy="true"> 
      <readerQuotas maxDepth="32" maxStringContentLength="8192" 
       maxArrayLength="16384" maxBytesPerRead="4096"maxNameTableCharCount="16384"    
       /> 
      <security mode="None"> 
      <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
     </security> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="MyService.WCFService.RoutingServiceBehavior" name="MyService.WCFService.RoutingService"> 
     <endpoint binding="basicHttpBinding" 
      bindingConfiguration="windowsBasicHttpBinding" name="basicEndPoint"   
      contract="MyService.WCFService.IRoutingService" /> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="CityOfMesa.ApprovalRouting.WCFService.RoutingServiceBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
    </serviceBehaviors> 
    </behaviors> 
</system.serviceModel> 

我應該在IIS配置或web.config設置來解決這個問題,尋找什麼。

+0

AppPool是否運行正確版本的ASP.NET? – 2012-02-23 22:28:33

+0

@Richard Blewett - 該服務被配置爲使用.NET 3.5框架。我遵循的是IIS 6.0中使用的相同配置,因爲您只能選擇.NET 1.1,2.0或4.0框架作爲asp.net IIS設置 – 2012-02-23 22:34:47

+0

應用程序池正在運行的標識是否可以訪問物理位置的服務文件? – 2012-02-23 23:17:19

回答

1

我必須從我的web.config中刪除以下部分,獲得對Windows服務器IIS 7.5下的服務運行2008 R2:

<modules> 
     <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    </modules> 
    <handlers> 
     <remove name="WebServiceHandlerFactory-Integrated"/> 
     <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" 
      type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" 
      type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
    </handlers> 
0

執行與提升的權限下面的命令(如管理員):

"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -i