If you want to debug a WCF service you may encounter the following error in Visual Studio:
IIS specified authentication schemes 'IntegratedWindowsAuthentication, 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.. ---> System.InvalidOperationException: IIS specified authentication schemes 'IntegratedWindowsAuthentication, 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
This can occur if the virtual directory hosting the service in IIS has both the Intergrated Windows Authentication and Anonymous authentication schemes selected. In order to get around this so that you can debug your service, you can do the following:
- In IIS, uncheck the Annonymous scheme
- In IIS, leave Integrated Windows Authentication checked - this is required to run the VS Debugger
- Start the debugger from VS
- Before you make a request to your service, go back into IIS and check the Annonymous scheme
- Make a request to your service and your break point will be hit