Reputation: 1126
What is the difference between developing WCF service by opening a console application project(generally) and a WCF project? By creating a WCF service project, the auto generated files consist of app_data, IService1.cs , Service1.svc and web.config. What is the purpose of those files?
thanks!
Upvotes: 0
Views: 144
Reputation: 8290
a WCF service project is a web project designed to run in IIS.
The web.config file contains the configuration of the web app (and the WCF service configuration -endpoint, behaviors, bindings)
The svc file is the web resource your client will call, it associates an url (service1.svc) with a service contract.
The IService1.cs file contains the service contract interface.
there is a Service.svc.cs file too which contains the service contract implementation.
If you use WCF in a console project, you will have to start WCF yourself (ServiceHost etc...) If you use WCF in a web application, this logic is handled by the service activation framework in IIS, using the configuration provided by web.config.
IIS activated WCF services are easier to use, but require to be hosted by the web server.
Upvotes: 1