Web service failed to start because of wrong IIS configuration

/*Author: Jiangong SUN*/


I‘ve encountered a problem when I deploy a web service in a new environment. While I‘ve used the same binary work correctly in another server.


Here is a error message:

System.ServiceModel.ServiceActivationException: The service ‘‘ cannot be activated due to an exception during compilation. 

The exception message is: The authentication schemes configured on the host (‘IntegratedWindowsAuthentication‘) do not allow those configured on the binding ‘WSHttpBinding‘ (‘Anonymous‘). Please ensure that the SecurityMode is set to Transport or TransportCredentialOnly.

Additionally, this may be resolved by changing the authentication schemes for this application through the IIS management tool, through the ServiceHost.Authentication.AuthenticationSchemes property, in the application configuration file at the <serviceAuthenticationManager> element, by updating the ClientCredentialType property on the binding, or by adjusting the AuthenticationScheme property on the HttpTransportBindingElement.. ---> System.NotSupportedException: The authentication schemes configured on the host (‘IntegratedWindowsAuthentication‘) do not allow those configured on the binding ‘WSHttpBinding‘ (‘Anonymous‘). 


So I‘ve found that it shouldn‘t be a problem of my code, while it‘s a problem of IIS configuration.


To check the configuration, you need to go to -> %systemroot%\System32\inetsrv\config

You can compare all the configurations between this server and another server where the service works in.

For me, it was a configuration problem in applicationHost.config. And I just need to activate the anonymous anthentication.

<location path="DEV.MARKET.Global">
        <system.webServer>
            <security>
                <authentication>
                    <anonymousAuthentication enabled="true" />
                    <windowsAuthentication enabled="true" authPersistNonNTLM="true" />
                </authentication>
            </security>
        </system.webServer>
    </location>

So the probme is solved!

Hoping this post can help others! :)


Web service failed to start because of wrong IIS configuration

上一篇:AspNetPage 使用案例


下一篇:JBoss 系列九十三: 高性能非阻塞 Web 服务器 Undertow