As you all know exceptions is not serializable in general and after catching some very strange bugs in various serializers upon serialization/deserialization of different .NET Exceptions, I came up with simple DTO for trasport level:
[DataContract]
public class Error
{
[DataMember]
public string Message {get;set;}
[DataMember]
public string StackTrace {get;set;}
//all Exception fields here
}
I can successfuly transform Exception to Error class, but how to do the opposite? I mean, I want to throw it after actual transportation, with valid remote stack trace and everything as it was before transportation... One way is to use Reflection, but, duh, it is awful and looks unhealthy.