I was there when this feature was born. It’s a long story but basically the idea is that you should be able to have a WCF service (or Workflow Service for that matter) without a SVC file.
Simply put, an SVC file is configuration that lives in a file that gives IIS something to serve (after all it is a web server).
The .svc extension is handled by WCF so when a request comes into IIS with a URI that ends with .svc, WCF gets to handle it. You can find the details in your machine level web.config (just search for .svc).Here is an example of the markup you will find in an SVC file. To see this, just right click on a SVC file in Visual Studio and select View Markup
<@ ServiceHost Language="C#" Debug="true" Service="WebApplication1.Service1" CodeBehind="Service1.svc.cs" %>
As you can see, this configuration gives WCF the information it needs to build (if necessary) and host your service. Yes you can actually put code in an SVC file but I don’t recommend it. Usually all the code is in the code behind file.
Most people don’t mind .svc files. After all they are small 1 line text files. But if you have thousands of services and hundreds of web servers there is a certain amount of overhead involved in managing all these 1 line text files. The good news is that now with .NET 4 you can eliminate them if you want to.
Configuration Based Activation is the name of the feature that allows you to eliminate the .svc file. I’m going to walk you through step by step how you can eliminate an .svc file.
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" >
<add service="WebApplication1.Service1" relativeAddress ="Service1.svc"/>
Oh Yeah!!! Straight from Visual Studio 2010 Training Kit. Thanks.
@Magesh - this is in the VS2010 Training Kit? I know it's not in the What's new in WCF labs because I wrote that one. At any rate, the kit is super valuable