Difference between throw and throw ex in C#


There are difference between throw and throw Exception is Stack trace information that get sent with exception.

Throw: In throw, the original stack trace will be retained. To keep the original stack trace information the correct syntax is “Throw” without specifying exception.

Throw ex:In throw ex,the original stack trace will get override and you will lose the original exception stack trace. i.e. “throw ex” resets the stack trace.