1

I am in the process of moving a WCF service from IIS 6.0 to IIS 7.5 on a Windows Server 2008 R2 machine. When I browse to service using any of the major browsers, I get the following error:

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

I checked the server's event logs and do not see anything that looks out of the ordinary. The service's authentication settings is set to Anonymous. I tried setting the service's application pool Managed pipeline mode to both Integrated and Classic and I still get the same result. The .NET framework of the application pool is v2.0.50727.

Here is the system.serviceModel section in the service's web.config file:

<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>

What should I look for in my IIS configuration or web.config settings to fix this issue.

Michael Kniskern
  • 24,792
  • 68
  • 164
  • 231
  • Is the AppPool running the right version of ASP.NET? – Richard Blewett Feb 23 '12 at 22:28
  • @Richard Blewett - The service is configured to use the .NET 3.5 framework. I am following the same configuration that was used in IIS 6.0, since you can only choose .NET 1.1, 2.0 or the 4.0 frameworks for the asp.net IIS setting – Michael Kniskern Feb 23 '12 at 22:34
  • Does the identity the app pool is running under have access to the physical location of the service files? – Richard Blewett Feb 23 '12 at 23:17
  • @RichardBlewett- The app pool identity has Traverse folder / execute file, List Folder / read data, Read Attributes, Read extended attributes and Read permission using the Effective Permission look up. – Michael Kniskern Feb 23 '12 at 23:32

2 Answers2

1

I have to remove the following section from my web.config to get the service run under IIS 7.5 on Windows Servers 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>
Michael Kniskern
  • 24,792
  • 68
  • 164
  • 231
0

Execute the following command with elevated privileges (as administrator):

"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -i
Aaaaaaaa
  • 2,015
  • 3
  • 22
  • 40