Get the hresult from a managed exception

This comes up a lot on internal lists so I thought i'd share... from the

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

Comments (0)

Skip to main content