With WCF 4.0 comes a feature where in a developer will not required to have a .svc file physically. An svc file is required for the IIS or WAS so that the servicehost can instantiate a new service using IInstanceprovider and as specfied in svc markup.This can be circumvented in .NET 3.5 by writing a UrlReWrite module in IIS. But that gives you a new set of maintainability problems. This .svc file can be a bit painful in REST based services as it violates REST principles.But in .NET 4.0, dependency on ,.svc has been addressed and look how easy it is. Whats good is this can coupled with a custom service host. Lets look at the implemenation
I have a WCF service project configured as a virtual directory. My service class is "FileLessActivationTest1.Service1" where "FileLessActivationTest1" in the namespace. Open the web.config and enter the following.
Hold on, that wasnt the only thing .svc file achieved. It also had the option to specify a service host.
Lets define our custom service host as follows
The sample is here