In dotNet a line throws an exception and is caught, how can I figure out which line in which file threw the exception? Seems relatively straightforward, but I can\'t figure
You could use the StackFrame Class:
try { ... ... } catch(...) { StackFrame sf = new StackFrame(true); int lineNumber = sf.GetFileLineNumber(); int colNumber = sf.GetFileColumnNumber(); string fileName = sf.GetFileName(); string methodName = sf.GetMethod().Name; }