WCF - Basic Difference Between Service Application and Service Library
- In the WCF Service Application we have a service contract i.e. IService1 for the service implementation and Service1 as a Web.config file.
In the Service Library we also have a service contract i.e. IService1 for the service implementation and Service1 as an App.config file for the configuration (instead of web.config as in the Service Application).
- The major difference is that the WCF Service Application has a .svc file, whereas the WCF Service Library does not have a .svc file. Suppose we want to host this service application in IIS, then you need to specify for IIS the execution runtime environment requirements.
In a web application we set an .aspx, similarly for a Service Application we need to set a .svc.
- In WCF Service Application the Service1.svc is hosted by default by the ASP.NET Development server where as:
A WCF Service Library is not hosted by the ASP.Net development server. It is hosted by the Test Client, since a Service Library does not have .svc file.
- If you want to host your service in IIS then you should select the WCF Service Application template and if you want to host it as a Windows Service or set a reference of your library then you should select the WCF Service Library template.