Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

How to serialize exception

$
0
0

I want to log exception into database using enterprise library. To do that i need to convert System.Exception to string. I can recursively traverse the inner exception and create string. but that will not capture other properties of the exception. For example if the exception is of type FaultException<T>, then "Detail property will not get captured.

if i try to serialize Exception then it fails while serializing Data property because it is of type IDictionary

Exception.ToString() method also doesn't capture inner exceptions with stack trace, and other propertes ( im not sure about this, can someone confirm?)

So how convert Exception into String?

 

Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>