T
Tristan MSDN Keen
I've written a test harness in C# to test one of our company's products,
which is written in C.
If the application crashes, the Instruction Address, Memory Address and the
Access Type are stored in the private fields _ip, _target and _accessType of
the AccessViolationException that is thrown. I want to be able to report
these errors to the user in the C# harness to assist in writing defect
reports for the development teams.
I can only access these fields using Reflection. My question is why is this
informative information kept in private fields in the exception, and not
available as a public Property? It would also seem to make sense for this
information to be reported in the Message property as well.
If the crash occurs when running the product directly, i.e. in C, this
information is reported by Windows, so it seems at first glance a step
backwards to not report this information when the AccessViolationException is
thrown from the P/Invoke.
which is written in C.
If the application crashes, the Instruction Address, Memory Address and the
Access Type are stored in the private fields _ip, _target and _accessType of
the AccessViolationException that is thrown. I want to be able to report
these errors to the user in the C# harness to assist in writing defect
reports for the development teams.
I can only access these fields using Reflection. My question is why is this
informative information kept in private fields in the exception, and not
available as a public Property? It would also seem to make sense for this
information to be reported in the Message property as well.
If the crash occurs when running the product directly, i.e. in C, this
information is reported by Windows, so it seems at first glance a step
backwards to not report this information when the AccessViolationException is
thrown from the P/Invoke.