FaultContractAttribute Constructor (Type^)
.NET Framework (current version)
Initializes a new instance of the FaultContractAttribute class.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Parameters
- detailType
-
Type:
System::Type^
The serializable type that contains error information for the caller.
| Exception | Condition |
|---|---|
| ArgumentNullException | The detailType argument is null. |
The constructor is typically executed by applying the attribute to a service method and specifying a type as the argument in the attribute.
The following code example shows the use of FaultContractAttribute to specify that the SampleMethod operation can return a SOAP fault with the detail type of GreetingFault.
Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Show: