Tuesday, June 7, 2011

WCF - The page you are requesting cannot be served because of the extension configuration

The page you are requesting cannot be served because of the extension configuration.
Today I was getting bored. So just for time pass I was uninstalling and installing IIS repeatedly. Just for fun. Sounds crazy right? But I was doing it.
Finally at the second half my team lead asked me to create a sample WCF service and host in IIS with some useless functionality. J


Well, I created WCF, hosted in IIS. When I browsed .svc page, I received following error –
HTTP Error 404.3 – Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.


This was the point when I was happy!! J
Cause of the Problem – If you have Visual studio installed, then uninstall and install IIS again, then you will get above error. Due to uninstall of IIS, extension mappings for WCF SVC file were removed.
Applicable technology is IIS 7.0, VS 2008 and above.
Solution –
1.     Open visual studio command prompt as Administrator.
2.     Change directory to “c:\windows\Microsoft.Net\v3.0\windows communication foundation”.
3.     Run the command “servicemodelreg –i” (without quotes).
This command line tools provides the ability to manage the registration of ServiceModel on a single machine.
-I switch in above command registers and update the script maps at IIS metabase root and for all script maps under the root.
Hope this helps.
Cheers…
Happy coding!!

5 comments:

  1. ya..its really helpful
    thanks a lot 4 your help...
    i spent lot of time to solve this problem

    ReplyDelete
  2. Thanks for the information

    ReplyDelete
  3. after doing the setting, I am getting the below error.

    Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    ReplyDelete
    Replies
    1. Did you get a fix for above problem? I am facing the same!

      Delete