Get the hresult from a managed exception


This comes up a lot on internal lists so I thought i’d share… from the
FAQ:


class=513433320-15042003>Get the hresult by calling
System.Runtime.InteropServices.Marshal.GetHRForException() on the Exception
object. style="mso-spacerun: yes">  style="FONT-SIZE: 10pt; COLOR: #00007f; FONT-FAMILY: Arial">If that info is not
readily available, you may need to attach a debugger and set it to catch managed
exceptions.  Then, get the hresult
by retrieving the private _HResult field of the managed Exception
object.

Comments (0)