Microsoft
70-513 · Question #10
You are developing a Windows Service. The Windows Service will host a Windows Communication Foundation (WCF) service. The Windows Service class will inherit from ServiceBase. You need to ensure that…
The correct answer is B. Override the OnStart method and create and open a new ServiceHost. See the full explanation below for the reasoning.
Question
You are developing a Windows Service. The Windows Service will host a Windows Communication Foundation (WCF) service. The Windows Service class will inherit from ServiceBase. You need to ensure that the WCF service starts when the Windows Service is restarted. What should you do in the Windows Service class?
Options
- ACreate a public method named Main.
- BOverride the OnStart method and create and open a new ServiceHost.
- COverride the OnPowerEvent method and open a new ServiceHost.
- DOverride the OnContinue method and open a new ServiceHost.
How the community answered
(20 responses)- A5% (1)
- B80% (16)
- C5% (1)
- D10% (2)
Community Discussion
No community discussion yet for this question.