Is it possible to extract the Class name and the Filename from an exception object?
I am looking to integrate better logging into my application, and I want to include detailed information of where the exception occurred.
In MVC the Stacktrace does not return the filename & class name, and I’m a bit lost as to where to look for these.
Thanks
You can create a
StackTraceobject from an exception object. It will include theStackFrames that the exception has info on. You could then find the file and method names, positions and whatnot if they are available. Of course this should go without saying but all of this is available only if you compiled your assembly to include debugging symbols (which I assume could be available in MVC).