This is not a C # question, but a CLI design question and comes down to various IL, throw and rethrow .
Basically, throw ex; (for any ex , even the original) is IL throw , where-as throw; is IL rethrow .
If you specify a throw specific exception, it follows that this exception logically comes from here, now, of this method. If this is not the case, then either:
throw;
not throw ex; or: wrap exception in another exception, so you keep the original exception and show where the new one came from:
throw new SomeException(ex);
and in this case, the caller can get the original stack trace through ex.InnerException .
source share