I have a DTO as below –
[Serializable()]
Public Class DTO
{
Public Exception ex {get;set;}
}
When i pass the object of type DTO from RIA service, on client side I do not see the property ex.
Please help me with this proble.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As a sidenote, I do not think of Exceptions should be send directly between clients/ server. Instead I recommend catching them at an appropriate point and re-format the exception information into something more generic before sending it to the receiving side.
As for your actual problem, you might have hit restrictions of the [Serializable] functionality. In MSDN article Serialization in Windows Communication Foundation it says (highlights by me):
You might implement your own custom error class that supports serializing.
See SO thread How to serialize an Exception object in C#? for an example.
[EDIT]
If that is too much effort, as a quick win, you could try to change the class definition into: