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! :)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值