public virtual Exception GetBaseException () { Exception inner = inner_exception; while (inner != null) { if (inner.InnerException != null) inner = inner.InnerException; else return inner; } return this; }