2012-02-23 54 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