WebServiceHostFactory Class
WebServiceHostFactory Class
[Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

A factory that provides instances of WebServiceHost in managed hosting environments where the host instance is created dynamically in response to incoming messages.

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

C#
public class WebServiceHostFactory : ServiceHostFactory
Visual Basic (Declaration)
Public Class WebServiceHostFactory _
	Inherits ServiceHostFactory
Visual Basic (Usage)
Dim instance As WebServiceHostFactory
Visual C++
public ref class WebServiceHostFactory : public ServiceHostFactory
J#
public class WebServiceHostFactory extends ServiceHostFactory
JScript
public class WebServiceHostFactory extends ServiceHostFactory

The managed hosting environments that support dynamic activation are Internet Information Services (IIS) and Windows Process Activation Service (WAS).

If you have implemented a custom derivative of WebServiceHost, consider also implementing a factory that derives from the WebServiceHostFactory class.

The following example shows how to derive a class from WebServiceHostFactory.

In order to have your derived Web service host factory used you will need to specify it in a .SVC file. The following example illustrates the syntax used in an .SVC file.

<%@ServiceHost language=c# Service="Microsoft.Samples.MyWCFService" Factory="Microsoft.Samples.MyWebServiceHostFactory" %>
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows Vista, Windows XP SP2, Windows Server 2003

The .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.5, 3.0
Page view tracker