Extend the ClientBase<(Of <(TChannel>)>) class to create a custom WCF client object that can be used to connect to a service. Typically, the WCF client base class is extended by a tool such as the ServiceModel Metadata Utility Tool (Svcutil.exe) on your behalf. For an example, see the Example section.
The ClientBase<(Of <(TChannel>)>) class can be used quickly and easily by developers who prefer objects to the use of the interfaces and the System.ServiceModel..::.ChannelFactory<(Of <(TChannel>)>) class. In all cases this class wraps or exposes the methods and functionality of the System.ServiceModel..::.ChannelFactory<(Of <(TChannel>)>) class and the System.ServiceModel..::.IClientChannel interface.
As when using the System.ServiceModel..::.ServiceHost class, you can create the class and modify the endpoint, channel factory, or security information prior to making any calls or calling Open. For more information, see WCF Client Overview and Accessing Services Using a WCF Client.
Special note for Managed C++ users deriving from this class:
Put your clean-up code in (On)(Begin)Close (and/or OnAbort), not in a destructor.
Avoid destructors: they cause the compiler to auto-generate IDisposable.
Avoid non-reference members: they can cause the compiler to auto-generate IDisposable.
Avoid finalizers; but if you include one, you should suppress the build warning and call SuppressFinalize(Object) and the finalizer itself from (On)(Begin)Close (and/or OnAbort) to emulate what would have been the auto-generated IDisposable behavior.