Q:

Hosting WCF service in an existing ASP.Net , Deployment Issue

I am trying to use an already existing ASP.net web application to host a WCF service, so I tried the following steps,
1- In Visual Studio 2010, I created web application through the Web > ASP.net Web Application template, named WebApp.
2- Added new WCF Service through Add > New Item ... > WCF Service , named MyServ.
3- Modified the DoWork() method in MyServ.svc as follows,
From
        public void DoWork()
        {
        }

To
        public string DoWork()
        {
             return "hello";
        }

and consequently I modified IMyServ.cs to match the new signature.
4- When I run the application on development server and visit http://localhost:1399/MyServ.svc  , the service runs fine.
5- So I create a publish for this application, to prepare it to be hosted on the IIS.
6- In the IIS, I create a new website named WebAppSite and is given the port 111, so now when I visit http://localhost:111/ , I am directed for the published WebApp site default page, which is fine and shows that the aspx part of the application is working fine on the IIS.
7- So I try to visit http://localhost:111/MyServ.svc to check if the service is successfully deployed, but I get this message,
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.
Any idea where the problem is?

A:

you need to register the .svc mime type in your IIS
run "\%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe -i"

