c# get innermost exception code example Example: c# get innermost exception while (e.InnerException != null) e = e.InnerException;