Add an explicit ctor reference to a ctor used by reflection for MonoTouch.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Tue, 7 Feb 2012 23:56:36 +0000 (00:56 +0100)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 8 Feb 2012 00:01:19 +0000 (01:01 +0100)
mcs/class/System.ServiceModel/System.ServiceModel/FaultException_1.cs

index 9727098e17245422d59eb4448e63c224dd5ecf00..7c647a77dc8c860a0dc2e76e9682754f1df2757e 100644 (file)
@@ -37,6 +37,14 @@ namespace System.ServiceModel
        {
                TDetail detail;
 
+#if MONOTOUCH
+               // WCF creates FaultExceptions using reflection, so unless we reference
+               // the corresponding ctor, it will not be possible to use FaultExceptions
+               // in MonoTouch. This ctor reference will work as long as TDetail
+               // is a reference type.
+               static FaultException<object> ctor_reference = new FaultException<object> (new object (), new FaultReason ("reason"), new FaultCode ("code"), "action");
+#endif
+
                public FaultException (TDetail detail)
                        : this (detail, "Unspecified ServiceModel Fault.")
                {