Given this stack
- net4/IIS7.x
- MVC3
- nHibernate
- Unity
But short of starting from scratch and producing a perfectly unit tested project, is there a strategy (or app/module) to eliminating the generic msg Object reference not set to an instance of an object. and throwing something more specific? Something akin to what ELMAH can do with exceptions?
thx
Looking at the exception stack trace and identifying the exact line where the exception is thrown is the best indication to pinpoint the problem. When you have identified the line of code on which this exception is thrown you will already have a strong indication of its origin. Narrowing it down to a simple project always help if you are not able to understand why it might occur. Given the stack you have shown there is close to ∞ possibilities of why this might be happening.
Don’t expect to get anything more specific than this exception and the line on which it occurs.