CoCreateInstance(CLSID_CorDebug) fails with 0x80131701 : Failed to find a required export in the runtime

0

I am trying to write an unmanaged debugger for the .NET framework, but when I try to get an instance of the core ICORDebug interface I get a runtime failure with the return value from CoCreateInstance. What am I doing wrong?

CComPtr<ICorDebug> debug;
HRESULT hr;    
hr=debug.CoCreateInstance(CLSID_CorDebug,NULL,CLSCTX_INPROC_SERVER);
//hr=0x80131701
.net
debugging
unmanaged
asked on Stack Overflow Feb 19, 2015 by henke37

1 Answer

0

.NET's execution engine returns error codes starting with 0x8013. The details are here: http://blogs.msdn.com/b/yizhang/archive/2010/12/17/interpreting-hresults-returned-from-net-clr-0x8013xxxx.aspx

Your particular code has something to do with "Export not found" which probably make more sense to an unmanaged C++ coder.

I don't see why you couldn't write an unmanaged program to debug managed .NET although it sounds like extra effort. ICorDebug is a COM interface anyway so if your debugger is managed then you'll learn a lot about COM Interop. :-)

answered on Stack Overflow Feb 20, 2015 by Wonko

User contributions licensed under CC BY-SA 3.0