Tag Archives: REST

Host RESTful WCF(3.5) Service – IIS 6.0 – HTTP 404 – File not found

I ran into this issue today, the fix is  simple and very easy to overlook.  I thought I’d share it.

HTTP Error 404 – File or directory not found.

Internet Information Services (IIS)

I was setting up a WCF REST service on a production server .  The service had been successfully running on two other servers in development and staging.  It runs in the Net 3.5 framework and is hosted in II6 on windows server 2003.

This server has a number of Net applications running , however, it didn’t appear that any websites or web services had been hosted in IIS. So I assumed it was just a setup issue, but setting the website to allow “Directory browsing” served up the directory listing. I began to Google and found a number of posts and articles on the subject.

Other developers reported solving similar issues by running ASPNET_REGIIS, ServiceModelReg.exe, setting up .svc MIME type, and creating a wild card mapping to aspnet_isapi.dll. I discounted the MIME type and wild card mapping since they were not required on our other servers. However, since we’d never hosted a website on this machine let alone a WCF service I decided to run the commands to register ASP.Net applications with IIS and the service modle registration tool. Neither of these solved the issue, so I played with directory security to make sure it matched our other servers, still no luck.

Finally, after a little more research I found that by default in II6 the ASP.net web service extension is set to a status of prohibited for security purposes.  The fix was as simple as opening Web Service Extensions in the IIS manager and setting the ASP.net extension to allowed.

The point is,I focused too much on the specifics of my problem and looked past the basic issue.  Which was that IIS had not been fully setup to host ASP.net applications.  I was “in the weeds” as they say.



%d bloggers like this: