This topic has not yet been rated - Rate this topic

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
);
iDebuggerVersion

[in] The version of ICorDebug that is expected by the debugger. See the CorDebugInterfaceVersion enumeration for valid values.

szDebuggeeVersion

[in] The common language runtime version associated with the application or process to be debugged. See the GetVersionFromProcess or GetRequestedRuntimeVersion method for information on retrieving this value.

ppCordb

[out] The location that receives a pointer to the ICorDebug object.

This method returns standard COM error codes as defined in the WinError.h file in addition to the following values.

Return code

Description

S_OK

The method completed successfully.

E_INVALIDARG

szDebuggeeVersion or ppCordb is null, or the version string is incorrect.

The szDebuggeeVersion parameter maps to the corresponding version of MSCorDbi.dll.

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

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Depricated?

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