nerdexam
Microsoft

70-513 · Question #179

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…

The correct answer is D. host = New ServiceHost(GetType(DataAccessService)). See the full explanation below for the reasoning.

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.) 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?

Exhibit

70-513 question #179 exhibit

Options

  • Ahost = New ServiceHost("MyApplication.DataAccessService")
  • Bhost = New ServiceHost("MyApplication.IDataAccess")
  • Chost = New ServiceHost(GetType(IDataAccess))
  • Dhost = New ServiceHost(GetType(DataAccessService))

How the community answered

(19 responses)
  • A
    11% (2)
  • B
    5% (1)
  • C
    16% (3)
  • D
    68% (13)

Community Discussion

No community discussion yet for this question.

Full 70-513 Practice