CreateDebuggingInterfaceFromVersion Function
Creates an ICorDebug object based on the specified version information.
This function is obselete in the .NET Framework version 4. Instead, use the ICLRRuntimeInfo::GetInterface method.
HRESULT CreateDebuggingInterfaceFromVersion (
[in] int iDebuggerVersion,
[in] LPCWSTR szDebuggeeVersion,
[out] IUnknown **ppCordb
);
Platforms: See .NET Framework System Requirements.
Header: MSCorEE.h
Library: MSCorEE.dll
.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0
The debugging docs seem woefully out of date.
I keep reading that ICorDebug was completely revamped for CLR4 and I'm unable to find anything relevent on MSDN. And now I get here and it tells me to use a different method to fetch an instance of an object implementing this interface; except when I read the docs for that interface, it lists the objects it supports returning and NONE of them are ICorDebug.
What's the deal?
ICLRRuntimeInfo.GetInterface
CreateDebuggingInterfaceFromVersion in fact is deprecated, but unfortunately, more detailed information on the non-deprecated alternative to CreateDebuggingInterfaceFromVersion was somehow omitted from the documentation for the .NET Framework 4. The non-deprecated alternative is ICLRRuntime.Info.GetInterface, which can be called as follows:
GetInterface(CLSID_CLRDebuggingLegacy, IID_ICorDebug, &pICorDebug)
CLSID_CLRDebuggingLegacy and IID_ICorDebug are defined in metahost.h but were inadvertently omitted from the list of values that can be passed to the method. The documentation will be updated during the next documentation refresh to correct this oversight.
--Ron Petrusha
Common Language Runtime User Education
Microsoft Corporation
- 12/16/2010
- mprobins
- 9/12/2011
- R Petrusha - MSFT