You need to ensure that the WCF service starts when the Windows Service is restarted

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?

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?

A.
• Override the OnStart method and create and open a new ServiceHost. • Override the
OnStop method and close the ServiceHost.

B.
• Override the OnPowerEvent method and open a new ServiceHost. • Override the
OnShutdown method and close the ServiceHost.

C.
• Create a public method named Main. • Create a new ServiceHost in the Main method. •
Override the OnShutdown method and close the ServiceHost.

D.
• Override the OnContinue method and open a new ServiceHost. • Override the OnStop
method and close the ServiceHost.



Leave a Reply 0

Your email address will not be published. Required fields are marked *