First attempt to host a WCF Service on IIS 7.0

I spent a couple of hours this evening trying to get IIS up and running on my Vista machine during my first day attempts at WCF. I installed IIS after installing the .Net SDK and as expected mappings and setting for ASP.Net are not in place. I ran the aspnet_regiis.exe and turned on the IIS Metabase and IIS 6 configuration compatibility feature.

Here is a quick and short article on Managing IIS 6.0 Servers from Windows Vista. Though the IIS is working, next thing I ran into is the debugging issues, I couldn’t debug the ASP.Net. I found this entry from Scott which recommends installing the Hot-fix patch. Hoping everything would work fine now, I tried to access a WCF service (.svc file), but still no luck. Got Cannot Find Server (404) or Get Plain Text for WCF .svc Files From IIS error which made me think if .svc is not supported in IIS which can’t be true. The reason we saw this is because the IIS Metabase got messed up by the WCF installation.

I downloaded the CleanIISScriptMaps.exe and ran it without any arguments, after running it seemed to work fine, I had a feeling I am getting closer. Now, I tried to view the service in the browser, but got this error. Security settings for this service require ‘Anonymous’ Authentication but it is not enabled for the IIS application that hosts this service.

So, I enabled the Anonymous Authentication in the IIS settings and it worked. Finally I was able to look at the service in the browser.

So, here is a quick review of what I did.

  1. Ran the aspnet_regiis.exe.
  2. Turned on the IIS Metabase and IIS 6 configuration compatibility feature.
  3. Installed the Hot-fix patch to enable ASP.Net debugging on IIS 7.0
  4. Cleaned the IIS ScriptMaps by running CleanIISScriptMaps.exe
  5. Enabled the anonymous authentication in the IIS settings.

Hope this will save a few of you a couple of hours.