Appendix D. .NET Exception to HRESULT Transformations

Every .NET exception type has a protected HResult field that is exposed to COM as an HRESULT when the exception is thrown. This appendix lists the HRESULT value for every .NET exception defined in the .NET Framework—more than just the mscorlib assembly.

Table D.1 lists the HRESULTs numerically, answering a COM programmer’s question, “What .NET exception was likely thrown to cause this failure HRESULT?” Some of this information can be obtained programmatically by calling the System.Runtime.InteropServices.Marshal.ThrowExceptionForHR method, but only for a subset of the HRESULTs. The word “likely” is used because, in general, it’s impossible to know what .NET exception was thrown from an ...

Get .NET and COM: The Complete Interoperability Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.