BindingElement.CanBuildChannelFactory<(Of <(TChannel>)>) Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns a value that indicates whether the binding element can build a channel factory for a specific type of channel.

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


Public Overridable Function CanBuildChannelFactory(Of TChannel) ( _
    context As BindingContext _
) As Boolean
public virtual bool CanBuildChannelFactory<TChannel>(
    BindingContext context

Type Parameters

  • TChannel
    The type of channel the channel factory produces.


Return Value

Type: System..::.Boolean
true if the IChannelFactory<(Of <(TChannel>)>) of type TChannel can be built by the binding element; otherwise, false.


Exception Condition

context is nullNothingnullptra null reference (Nothing in Visual Basic).


Use this method if you want to check that the channel factory for channels of type TChannel can be build for the context provided before attempting to build the factory. Alternatively, build the channel factory by calling BuildChannelFactory<(Of <(TChannel>)>) and catch the exception generated if it cannot be built.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0


Windows Phone

See Also


BindingElement Class

System.ServiceModel.Channels Namespace