Reputation: 6158
Here is a question for WCF hosting environment:
You are developing an application that performs file backups in the background. The background application will host a Windows Communication Foundation (WCF) service and must be active as soon as the machine is running. The background application will not have a user interface. A front-end application will consume the WCF service and will provide the user interface.
You need to choose a host environment for the WCF service. Which hosting environment should you choose?
- A. Microsoft Internet Information Services (IIS) 6.0
- B. Windows Process Activation Services (WAS)
- C. A Windows Forms application
- D. A Windows Service
The answer is D, but a lot documents of WCF MSDN and books all favor IIS/WAS over Windows Service, as they are more robust and resilient etc. I don't really see why it has to be D here. What is the reasoning behind D then?
Upvotes: 0
Views: 488
Reputation: 570
IIS gives on-demand loading. When a request comes in, the ServiceHost is constructed, then the service class being hosted is instantiated, and the request is handled. Nothing needs to be running around the clock. This setup requires more time and effort every time a message comes in.
Upvotes: 1
Reputation: 1128
The answer is D, because one of the requirements is:
must be active as soon as the machine is running.
When you use Windows Service you can start it even before user has authorized in system.
Upvotes: 5