ServiceHostFactory.CreateServiceHost Method (String, Uri())
.NET Framework (current version)
Creates a ServiceHost with specific base addresses and initializes it with specified data.
Assembly: System.ServiceModel.Activation (in System.ServiceModel.Activation.dll)
Public Overrides Function CreateServiceHost ( constructorString As String, baseAddresses As Uri() ) As ServiceHostBase
Parameters
- constructorString
-
Type:
System.String
The initialization data passed to the ServiceHostBase instance being constructed by the factory.
- baseAddresses
-
Type:
System.Uri()
The Array of type Uri that contains the base addresses for the service hosted.
| Exception | Condition |
|---|---|
| ArgumentNullException | baseAddress is null. |
| InvalidOperationException | There is no hosting context provided or constructorString is null or empty. |
This example shows how to use the CreateServiceHost(String, Uri()) method:
Public Overrides Overloads Function CreateServiceHost(ByVal service As String, ByVal baseAddresses() As Uri) As ServiceHostBase ' The service parameter is ignored here because we know our service. Dim serviceHost As New ServiceHost(GetType(HelloService), baseAddresses) Return serviceHost End Function
.NET Framework
Available since 3.0
Available since 3.0
Show: