【发布时间】:2012-03-14 08:19:41
【问题描述】:
我正在 Windows Server 2008 R2 机器上将 WCF 服务从 IIS 6.0 移动到 IIS 7.5。当我使用任何主流浏览器浏览服务时,都会收到以下错误:
500 - 内部服务器错误。
您正在寻找的资源,它无法显示。
我检查了服务器的事件日志,没有发现任何异常。服务的身份验证设置设置为匿名。我尝试将服务的应用程序池托管管道模式设置为集成和经典,但我仍然得到相同的结果。应用程序池的 .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 设置中寻找什么来解决这个问题。
【问题讨论】:
-
AppPool 是否运行正确版本的 ASP.NET?
-
@Richard Blewett - 服务配置为使用 .NET 3.5 框架。我遵循在 IIS 6.0 中使用的相同配置,因为您只能为 asp.net IIS 设置选择 .NET 1.1、2.0 或 4.0 框架
-
运行应用程序池的身份是否有权访问服务文件的物理位置?
-
@RichardBlewett- 应用程序池标识具有遍历文件夹/执行文件、列出文件夹/读取数据、读取属性、读取扩展属性和使用有效权限查找的读取权限。
标签: wcf iis-6 iis-7.5 windows-server-2008-r2