WebScriptServiceHostFactory::CreateServiceHost Method (Type^, array<Uri^>^)

 

Creates a derived class of ServiceHost for a specified type of service with a specific base address that can be used to automatically enable ASP.NET AJAX endpoints in certain scenarios.

Namespace:   System.ServiceModel.Activation
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)

protected:
virtual ServiceHost^ CreateServiceHost(
	Type^ serviceType,
	array<Uri^>^ baseAddresses
) override

Parameters

serviceType
Type: System::Type^

The type of service to host.

baseAddresses
Type: array<System::Uri^>^

The Array of type Uri that contains the base addresses for the service hosted.

Return Value

Type: System.ServiceModel::ServiceHost^

A ServiceHost for the type of service specified with the specified base address.

Exception Condition
InvalidOperationException

Another service uses the same base address, or another endpoint is using the same address as the ASP.NET AJAX endpoint that this factory is trying to create.

Normally, this method is called automatically by Windows Communication Foundation (WCF) as part of service activation - there is no need to call this method manually.

.NET Framework
Available since 3.5
Return to top
Show: