C# – Help: How to enable Windows Authentication on ASP.NET Development Server

asp.netciisvisual studiowcf

I hope any of you guys knows how to fix this issue we are having.

We are trying to host a WCF service via the web. We set the web.config to have the service require windows authentication. The problem we are having is the following:

When we host our service in a regular IIS, the service runs fine and there is no issues with the "Windows Authentication" mode. However, when we try to run it from our developer boxes we get the following error: "Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service."

Our developers boxes are not hosting the service through the regular IIS but rather through Visual Studio's APS.NET Development Server. We tried going into the web project properties and said to enable NTLM authentication but that still did not fix it. Does anyone know how to fix it? Does VS ASP.NET Development Server even support Windows Authentication? Is the only option for hosting the service with Windows Authentication is to use IIS and forget about ASP.NET Development Server?

Thanks
Chuck

Best Answer

In order to configure IIS Express security settings:

  1. look for the IIS express symbol in the taskbar (system tray).
  2. Right click and select "All Applications".
  3. Click on the name of the site you want to change (although I believe the change is site wide)
  4. Click on the path in the config section below (it will open the applicationhost.config file)
  5. Search for the authentication section and make your changes

Example changes can be found here:

http://toadcode.blogspot.ca/2011/08/security-config-in-iis-express.html