InstanceContext.Host Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the host for the service instance.
public:
property System::ServiceModel::ServiceHostBase ^ Host { System::ServiceModel::ServiceHostBase ^ get(); };
public System.ServiceModel.ServiceHostBase Host { get; }
member this.Host : System.ServiceModel.ServiceHostBase
Public ReadOnly Property Host As ServiceHostBase
Property Value
The ServiceHostBase that hosts the service instance.
Exceptions
The service instance associated with this context is closed, but was not aborted.
The service instance associated with this context is in a faulted state.
Examples
The following code shows how to access the Host property:
Uri baseAddress = new Uri("http://localhost:8000/ServiceModelSamples/service");
CalculatorService service = new CalculatorService();
ServiceHost serviceHost = new ServiceHost(service, baseAddress);
InstanceContext instanceContext = new InstanceContext(serviceHost, service);
ServiceHost host = (ServiceHost) instanceContext.Host;
Applies to
Dolgozzon együtt velünk a GitHubon
A tartalom forrása a GitHubon található, ahol létrehozhat és áttekinthet problémákat és lekéréses kérelmeket is. További információért tekintse meg a közreműködői útmutatónkat.