ClientBase<TChannel> Constructor ()
Initializes a new instance of the ClientBase<TChannel> class using the default target endpoint from the application configuration file.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
| Exception | Condition |
|---|---|
| InvalidOperationException | Either there is no default endpoint information in the configuration file, more than one endpoint in the file, or no configuration file. |
Use this constructor to create a WCF client object to invoke a service. This constructor uses the type parameter as the target contract and the binding and address information from the application configuration file.
The following code example shows how a client uses this constructor in a SampleServiceClient class that extends the ClientBase<TChannel> class.
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0