Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include Exceptions as DataMember for DataContractSerializer WCF C#

I want to return an array of exceptions in the DataContract from the WCF but it is not working.

    [DataContract]
    public class ProcessResult
    {
        [DataMember]
        public ProcessStatus EndStatus { get; set; }

        [DataMember]
        public Exception[] CaughtExceptionList { get; set; }

        [DataMember]
        public string CowListXML { get; set; }

    }

When i make the WCF call i get this exception

The underlying connection was closed: The connection was closed unexpectedly.

I commented out/ignored the exception list as a data-member and i was able to get results back perfectly.

Thanks!

like image 352
Ramie Avatar asked Feb 12 '26 23:02

Ramie


1 Answers

I believe the ExceptionDetail class is what you are looking for.

like image 110
Alan Avatar answered Feb 15 '26 03:02

Alan