Reputation: 43
I need to pass system.exception class instance to the WCF Service method.
If you have any idea about this, please share it.
Upvotes: 2
Views: 1023
Reputation: 5322
This is a very dangerous idea, because some exceptions are not serializeable and will cause other exceptions when you try to pass them.
WCF has FaultContracts which are the way to go when handling exceptions. Here is a an example: http://msdn.microsoft.com/en-us/library/ff650899.aspx
Upvotes: 4
Reputation: 87
If you are trying to pass an Exception as a method parameter to a WCF Service I guess your design has a flaw.
Passing an Exception instance as a parameter is definitely not the best way to transmit errors with WCF.
Upvotes: 0