I have an asp.net MVC app in production that very seldom but very consistently is throwing the same exception and I don't know why. I cannot, no matter what I do, reproduce the exception in neither the production nor development environments.
I am logging all unhandled exceptions. I have the date/time, controller, action, exception message, and call stack of each logged exception. So, I have a good idea where this is happening. Just not why.
To solve, I am considering wrapping this code in a try/catch and manually logging the names/values of all relevant variables. I would deploy this new logging capability and once solved, I would remove it.
But, then I was thinking how I bet there is a better, more portable way of doing this. Can anyone help?