Gets version and directory information about the common language runtime (CLR) requested by an application.
This function has been deprecated in the .NET Framework 4.
HRESULT GetRequestedRuntimeInfo ( [in] LPCWSTR pExe, [in] LPCWSTR pwszVersion, [in] LPCWSTR pConfigurationFile, [in] DWORD startupFlags, [in] DWORD runtimeInfoFlags, [out] LPWSTR pDirectory, [in] DWORD dwDirectory, [out] DWORD *dwDirectoryLength, [out] LPWSTR pVersion, [in] DWORD cchBuffer, [out] DWORD *dwlength );
[in] The name of the application.
[in] A string specifying the version number of the runtime.
[in] The name of the configuration file that is associated with
[in] One or more of the STARTUP_FLAGS enumeration values.
[in] One or more of the RUNTIME_INFO_FLAGS enumeration values.
[out] A buffer that contains the directory path to the runtime upon successful completion.
[in] The length of the directory buffer.
[out] A pointer to the length of the directory path string.
[out] A buffer that contains the version number of the runtime upon successful completion.
[in] The length of the version string buffer.
[out] A pointer to the length of the version string.
This method returns standard Component Object Model (COM) error codes, as defined in WinError.h, in addition to the following values.
|S_OK||The method completed successfully.|
|ERROR_INSUFFICIENT_BUFFER||The directory buffer is not large enough to store the directory path.
- or -
The version buffer is not large enough to store the version string.
GetRequestedRuntimeInfo method returns run-time information about the version loaded into the process, which is not necessarily the latest version installed on the computer.
In the .NET Framework version 2.0, you can get information about the latest installed version by using the
GetRequestedRuntimeInfo method as follows:
pConfigurationFileparameters as null.
Specify the RUNTIME_INFO_UPGRADE_VERSION flag in the
RUNTIME_INFO_FLAGSenumerations for the
GetRequestedRuntimeInfo method does not return the latest CLR version in the following circumstances:
An application configuration file that specifies loading a particular CLR version exists. Note that the .NET Framework will use the configuration file even if you specify null for the
The CorBindToRuntimeEx method was called specifying an earlier CLR version.
An application that was compiled for an earlier CLR version is currently running.
runtimeInfoFlags parameter, you can specify only one of the architecture constants of the
RUNTIME_INFO_FLAGS enumeration at a time:
Platforms: See System Requirements.
.NET Framework Versions: Available since 1.1