You need to ensure that the service is not blocked while the UI thread is busy

You are developing a Windows Communication Foundation (WCF) service that is hosted by
a Windows Forms application. The ServiceHost instance is created in the Form constructor.
You need to ensure that the service is not blocked while the UI thread is busy. What should
you do?

You are developing a Windows Communication Foundation (WCF) service that is hosted by
a Windows Forms application. The ServiceHost instance is created in the Form constructor.
You need to ensure that the service is not blocked while the UI thread is busy. What should
you do?

A.
Call the BeginInvoke method of the form and supply a delegate.

B.
Decorate the service implementation class with the following line of code.
[ServiceBehavior( UseSynchronizationContext = false)]

C.
Decorate the service implementation class with the following line of code.
[ServiceBehavior( ConcurrencyMode = ConcurrencyMode.Multiple)]

D.
Call the Invoke method of the form and supply a delegate.



Leave a Reply 0

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