How can I set the InnerException property of an Exception object, while I'm in the constructor of that object? This boils down to finding and setting the backing field of a property that has no setter.
If your answer is this cannot be done, don't answer please!
I'm saying this because it should be possible via reflection, so if you know how to do it, please enlighten me.
btw: I have seen this (http://evain.net/blog/articles/2009/05/01/getting-the-field-backing-a-property-using-reflection) but looking for non IL-based solution, if possible.
Thanks for the initial input, but I should have clarified that the Exception constructor is the place where the Exception type is created, so I cannot call it using the base class constructor MyException() :base(...) etc.
This is why I'm looking into attempting to alter the backing field via reflection, as the property is get only.