CLR HRESULT

CLR HRESULT’ facility code is 0x13. If an HRESULT error is 0x8013xxxx, it is likely a CLR error.

All CLR errors are defined in CorError.h. You can find CorError.h in your Visual Studio install (or Microsoft Platform SDK).

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\CorError.h

For example,

#define FUSION_E_REF_DEF_MISMATCH EMAKEHR(0x1040) // The located assembly's manifest definition does not match the assembly reference.

That is, 0x80131040 is FUSION_E_REF_DEF_MISMATCH.