Share via


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

Technorati Tags: IIS 7.0,WCF,Service Model,ServiceModelReg

Recently, I migrated to Windows 7 and ended up installing all my software's again. I had a project which involved hosting a WCF service on IIS. The service used a .svc file extension and IIS 7 on my machine was not aware how to handle these files.

The error I got looked something like this:

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. Detailed Error InformationModule StaticFileModule.

There were more errors related to local machine below these errors.I looked up the net and after some digging figured out the solution to the problem:

  1. Run Visual Studio 2008 Command Prompt as “Administrator”.
  2. Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.
  3. Run this command servicemodelreg –i.

The servicemodelreg is a command line tool which provides the ability to manage the registration on ServiceModel on a machine. You can get more info on the tool at MSDN here.

I guess the mistake I made was enabling IIS post installing VS and .NET 3.5 or else the services are not turned on for IIS 7.0 by default.

Comments

  • Anonymous
    July 31, 2009
    Thanks Rahul. This was very helpful and worked for me.

  • Anonymous
    August 15, 2009
    Thanks Rahul; you saved me on this!

  • Anonymous
    August 31, 2009
    Thanks a lot Rahul, this was absolutely spot on. Worked perfect for me.

  • Anonymous
    September 18, 2009
    The comment has been removed

  • Anonymous
    October 06, 2009
    I second all the comments. Very helpful indeed.

  • Anonymous
    October 07, 2009
    Very very helpful. This should be added to the MSDN article on how to host a WCF service. http://msdn.microsoft.com/en-us/library/ms733766.aspx

  • Anonymous
    October 07, 2009
    Great, thanks for sharing this with the community!

  • Anonymous
    October 15, 2009
    Note: this also applies to hosting Windows Azure WCF services on the local development fabric.

  • Anonymous
    October 31, 2009
    Dude This tip helped me a lot Thanks

  • Anonymous
    November 02, 2009
    Thanks a ton! I came to the point of giving up hosting the Web service in IIS!

  • Anonymous
    November 06, 2009
    Thanks alot this helped my WCF hosting issue, I was also on the point of giving it up.

  • Anonymous
    November 21, 2009
    Thanks Rahul, you are a star. keep it up!!

  • Anonymous
    December 06, 2009
    Thank you! It must be that the services are not turned on by default. I started with a fresh machine and begun by installing IIS 7 and then the rest and I also got the problem!

  • Anonymous
    February 01, 2010
    Perfect, thats exactly what I did, installed all the software then realised i forgot to install IIS. Works perfectly, cheers!

  • Anonymous
    February 11, 2010
    Thanks  - I forgot that the order of installation was important.

  • Anonymous
    February 23, 2010
    Nice! I installed VS 2008 prior to IIS too... But this did the trick!

  • Anonymous
    March 09, 2010
    saved lot of time.... else it will take more time to explore new OS features and find out the solution.. thanks buddy.... keep it up...

  • Anonymous
    April 07, 2010
    I am so happy I saw this. Thanks!

  • Anonymous
    April 30, 2010
    Thank you, this did the trick for me as well!

  • Anonymous
    May 04, 2010
    Right on!  This helped me, too - I wonder though, since I have .net 4.0 installed, will that be problematic?

  • Anonymous
    June 14, 2010
    Thanks-buddy it was awesome. Worked instantly... Cool :)

  • Anonymous
    June 16, 2010
    Thanks loot it works on the IIS 7 too

  • Anonymous
    October 04, 2010
    Didn't work for me :( please explain the steps again

  • Anonymous
    October 24, 2010
    Shruti, Are yoiu still getting this error ? Please provide me more details around the error and your environment and I can try and help you.

  • Anonymous
    December 15, 2010
    The comment has been removed

  • Anonymous
    December 29, 2010
    @Alan try running "aspnet_regiis.exe -i" in VS 2010 command prompt. That solved this issue for me.

  • Anonymous
    January 01, 2011
    @Klas: Thanks a lot buddy.. it worked finally for me with your command run from version 4.0 C:WindowsMicrosoft.NETFrameworkv4.0.30319>aspnet_regiis.exe -i Start installing ASP.NET (4.0.30319). ....... Finished installing ASP.NET (4.0.30319).

  • Anonymous
    January 19, 2011
    winsecondproblems.blogspot.com/.../http-error-4043-not-foundthe-page-you.html

  • Anonymous
    March 31, 2011
    thanks. this was really very helpful.

  • Anonymous
    May 04, 2011
    The comment has been removed

  • Anonymous
    May 23, 2011
    Thats right Dhaval. The steps you mentioned will also yeild the same result.

  • Anonymous
    June 07, 2011
    @Klas: Thanks a lot!!! in .NET 4.0 aspnet_regiis.exe -i did the trick

  • Anonymous
    June 22, 2011
    great

  • Anonymous
    August 06, 2011
    Thank you so much it solves my problem.. !!!

  • Anonymous
    November 13, 2011
    Thanks... worked for me perfectly !!! Thanks a lot for this post..

  • Anonymous
    February 08, 2012
    CamelCase: ServiceModelReg, otherwise it will not work

  • Anonymous
    February 24, 2012
    Exactly what I needed to get all the Handler Mappings configured for .cshtml (WebMatrix) For anyone else that needs more help on this Read about msdn.microsoft.com/.../k6h9cz8h%28v=VS.80%29.aspx Then use Command Prompt as Administrator cd C:WindowsMicrosoft.NetFrameworkv4.x aspnet_regiis.exe -i

  • Anonymous
    April 02, 2012
    thank for posting this great information

  • Anonymous
    April 09, 2012
    Thank you much man. I wish I had read your post 4 hours ago  which i wasted. :)

  • Anonymous
    May 20, 2012
    wowwwwwwwwwwwww........i wasted 24 hours time to this..............thanks alot dude

  • Anonymous
    June 07, 2012
    Amazing... it worked... it took me 2 hours..... this works like a charmmm ... Thanks alot

  • Anonymous
    July 25, 2012
    Thanks.......Rahul...........it solved my problem..............

  • Anonymous
    August 10, 2012
    Thank you very much Rahul... I am not a .Net guy... Was having a hard time to deploy a service locally...but I followed exactly what you have written... and BOOOOM!

  • Anonymous
    January 14, 2013
    This issue persists in VS2012. I suppose IIS team won't do VS team's job. Thank you for this.

  • Anonymous
    January 22, 2013
    Thanks Rahul. its woked for me ..:)

  • Anonymous
    March 05, 2013
    The comment has been removed

  • Anonymous
    March 09, 2013
    Desmond, Can you please let me know what is the scenario you are trying to achieve and I can try helping you.

  • Anonymous
    September 16, 2013
    Thanks a lot. I tried to run dis command from run, but problem was that  have to run it as administrator.

  • Anonymous
    July 20, 2014
    Hey; thanks for solution... but sadly it didnt work for me. The App Pool on which I am running my site is .NetFrame work 4.0; and I followed the steps provided by you, and ran it on VS2010 dev cmd prompt; but of no help; its still showing the same error. Pls help

  • Anonymous
    March 01, 2015
    Hi, I am also getting same error when I am trying to host the web service. Please guide me to solve this. Regards, Digvijay Singh