Error when accessing a WCF service: "IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme...

Programming, error messages and sample code
Error when accessing a WCF service: "IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used."

To resolve this problem, add the following to the web.config file to disable Basic authentication:

<system.webServer> 
     <security> 
            <authentication> 
                <basicAuthentication enabled="false" />
            </authentication> 
     </security> 
</system.webServer> 

Note that Anonymous authentication can also be disabled using:
<anonymousAuthentication enabled="false" />