Microsoft
70-513 · Question #45
70-513 Question #45: Real Exam Question with Answer & Explanation
Sign in or unlock 70-513 to reveal the answer and full explanation for question #45. The question stem and answer options stay visible for context.
Question
A Windows Communication Foundation (WCF) service is self-hosted in a console application. The service implements the IDataAccess contract, which is defined in the MyApplication namespace. The service is implemented in a class named DataAccessService which implements the IDataAccess interface and also is defined in the MyApplication namespace. The hosting code is as follows. (Line numbers are included for reference only.) 01 static void Main(string[] args) 02 { 03 ServiceHost host; 04 ... 05 host.Open(); 06 Console.ReadLine(); 07 host.Close(); 08 } You need to create a ServiceHost instance and assign it to the host variable. You also need to instantiate the service host. Which line of code should you insert at line 04?
Options
- Ahost = new ServiceHost("MyApplication.DataAccessService");
- Bhost = new ServiceHost("MyApplication.DataAccess");
- Chost = new ServiceHost(typeof(IDataAccess));
- Dhost = new ServiceHost(typeof(DataAccessService));
Unlock 70-513 to see the answer
You've previewed enough free 70-513 questions. Unlock 70-513 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.