Stack tracing is not enabled when the .net assembly is deployed in release mode. Thus, we cannot get the stack trace from the exception and register it in the production environment.
To find out where the exception occurred in the production code and register it, we use a strange approach that I donβt like, but I canβt come up with a better solution that records the exact method in which the exception occurred in the first place.
Please note that the logging mechanism is also used to detect errors. Therefore, when a NullReferenceException or IndexOutOfBoundsException occurs, getting the type of exception and message is impractical, we often need to know where exactly the exception occurred.
How do you deal with this? What information do you register in your production code when an exception occurs and how do you determine that the problem is in this information?
source
share