Hosting WCF / .svc Files in IIS7

Here are the steps that you need to go through to get a WCF service hosted in IIS7. I’ve had to track down this information a few different times, so I thought it was worth posting. The documentation for all of this exists, it’s just scattered and you can find multiple sets of instructions for hosting .svc files due to the changes in the earlier builds of Vista.

The first thing you need to do is install IIS7. To do this, go to Control Panel > Programs > “Turn Windows features on or off”

Select “Internet Information Services” and then drill down and make sure that ASP.Net is checked.

The next thing you need to do is install the other bits and pieces that WCF need to have to run in IIS. You can do this by running the command prompt (be sure to run as Administrator) and run ServiceModelReg.exe -i.

Now you should be good to go.

This entry was posted in .net. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

11 Comments

  1. Posted October 9, 2007 at 12:05 am | Permalink

    I tried this and I received this Error: Unable To initialize the native configuration support external to the web worker process (HRESULT=0×80004002). nativerd.dll must be in %windir%\system32\inetsrv.

    Well I checked and it IS in that folder. So what do you think is going on
    (and yes I was on Administrator mode..)

    I think I need to do that script because otherwise I cant even run my localhost to check if my webservice works. Im having error on the line:

    130:
    ——> 131:
    132:

  2. Posted October 9, 2007 at 12:06 am | Permalink
  3. Posted October 9, 2007 at 12:08 am | Permalink

    nevermind my paste…didnt work 2 times .. lol
    well the line was in web.config of my webservice

    I think i need to add a ligne of mimeMap for Svc files.

  4. sonny
    Posted October 26, 2007 at 3:10 pm | Permalink

    Where is this ServiceModelReg.exe ???
    Thx

  5. Posted October 26, 2007 at 7:07 pm | Permalink

    %SystemRoot%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\

    You could run the Visual Studio Command Prompt and you should be able to run the file.

  6. Brian
    Posted April 22, 2008 at 7:55 am | Permalink

    Thank you so much, this totally fixed my problem developing in my local IIS using .svc files in my cascadingdropdowns.

  7. Brian R
    Posted May 6, 2008 at 10:41 am | Permalink

    THANK YOU SO MUCH!!!!

    I’ve been googling this and have found a bunch of sites that give you crazy walkthroughs on how to manually add the handlers….

    I am glad I gave up on them thinking there must be an easier way! YOU ARE THE MAN! (or women)

  8. Posted June 8, 2009 at 12:54 pm | Permalink

    Thanks ; )

  9. AK
    Posted September 29, 2009 at 4:17 am | Permalink

    Thanks Mate !

  10. Posted November 17, 2009 at 8:40 pm | Permalink

    Thank you! Worked perfectly on 2008 64bit

  11. Posted February 21, 2010 at 5:59 am | Permalink

    Yep!
    That was it!
    Works!
    Thank you!

One Trackback

  1. [...] Original post by Ben Carey and software by Elliott Back Posted 18 Jan, 2007 | Categories: Uncategorized  [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>