You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
The service will be hosted in a Console application. You need to Configure the
service by using a configuration file other than the default app.config file
Which code segment should you use?
A.
class MyServiceHost : ServiceHost
{
public MyServiceHost(Type serviceType, params Uri[] baseAddresses) :
base(serviceType, baseAddresses){ }
protected override void InitializeRuntime()
{
//Load configuration here
}
}
B.
class MyServiceHost : ServiceHost
{
public MyServiceHost(Type serviceType, params Uri[] baseAddresses) :
base(serviceType, baseAddresses){ }
protected override void ApplyConfiguration()
{
//Load configuration here
}
}
C.
class MyServiceHost : ServiceHost
{
public MyServiceHost(Type serviceType, params Uri[] baseAddresses) :
base(serviceType, baseAddresses){ }
protected new void InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses)
{
//Load configuration here.
}
}
D.
class MyServiceHost : ServiceHost
{
public MyServiceHost(Type serviceType, params Uri[] baseAddresses) :
base(serviceType, baseAddresses){ }
protected new void AddBaseAddress(Uri baseAddress)
{
//Load configuration here.
}
}