How to setup IIS to work with WCF
By default WCF is not configured in IIS, the .svc handlers are usually missing so you won't be able to run or test your WCF project after publishing it. Adding .svc file mappings is the first step, and can be done easily by following the below steps:
1. On the server (where you want the .svc mappings to be set in IIS) go to this folder: %windir%\Microsoft.NET\Framework\v3.0\WindowsCommunication Foundation\
(note: if your IIS website application pool is configured to run in 64-bit mode, then select the Microsoft.NET\Framework64 folder instead of Microsoft.NET\Framework)
2. Run this exe in command prompt (as Administrator) with the -i option: ServiceModelReg.exe –i
So the complete command in cmd prompt would look like:
C:\Windows\Microsoft.NET\Framework\v3.0\WindowsCommunication Foundation\ServiceModelReg.exe –i
This will install the .svc bindings on the IIS, and now your service should run once published.