tags:

views:

43

answers:

1

When creating a WCF project, the default member files are just ordinary csharp class files, rather than svc files. Are svc files required with a WCF project? When should they be used?

+3  A: 

.svc files are used when you host your WCF service in IIS.

See Microsoft's doc here and here.

There's a module within IIS that handles the .svc file. Actually, it is the ASPNET ISAPI Module, which hands off the request for the .svc file to one of the handler factory types that has been configured for ASPNET, in this case

System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089


If you are hosting your WCF service in something other than IIS, then you don't need the .svc file.

Cheeso
What else can I host my service in?
CraigS
Three that come to mind are: A custom host that you write, a third-party provided host that you buy, or a Windows Service. http://msdn.microsoft.com/en-us/library/bb332338.aspx
Cheeso