adamjcooper.com/blog

Enterprise Software Development in C#


Getting WCF Services Running on IIS 6

Getting WCF services up and running on IIS 6 isn't hard if you know what to do. Here are the high points:

  1. Make sure ASP.NET is installed and registered with IIS on your web server
  2. Make sure WCF (.NET Framework 3.0/3.5) is installed
  3. Make sure that the .svc extension is mapped to the ASP.NET ISAPI dll in IIS

For me, it was point 3 that was the big problem. I found a lot of advice on various forums saying I should run the ServiceModelReg.exe tool to re-register the mapping and then restart IIS, but it never took. continued to receive HTTP 405 errors when trying to access the service, and apparently I'm not the only person who had this problem as evidenced by this forum post.

The solution was simple: I needed to add a mapping for .svc in IIS 6. It's not hard if you've done it before, but if you're not used to IIS 6's sometimes illogical user interface you can waste a lot of time poking around with the mouse. So here's a step-by-step guide.

How to Add the .svc Mapping to IIS 6

Open Internet Information Services (IIS) Manager:

image

 

Right-click on the website (or an individual web application) that needs the .svc mapping, then click Properties:

image

 

Go to the Home Directory tab and click the Configuration button:

image

 

Click the Add... button to add a new application extension mapping:

image

 

Set the Executable field to the location of the ASP.NET ISAPI dll, typically C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

Set the Extension field to .svc

Accept the default values for everything else and click OK

image

 

And that's it. Assuming you have ASP.NET and WCF (.NET 3.0/3.5) installed correctly on the server, adding this mapping should allow you to correctly serve up WCF services in your ASP.NET website (URLs that end in .svc).

(Note that if you're adding this mapping to a website that has some applications with the mapping already in place, IIS will ask you to confirm if the new value should overwrite the old.)

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading





 
Powered by BlogEngine.NET 1.4.5.0 | Design by adamjcooper