Gets an assembly's original .NET Framework compilation version (stored in the metadata), given its file path. This method supersedes the GetFileVersion function.
HRESULT GetVersionFromFile ( [in] LPCWSTR pwzFilePath, [out, size_is(*pcchBuffer)] LPWSTR pwzBuffer, [in, out] DWORD *pcchBuffer); );
[in] The complete assembly file path.
[out] The .NET Framework compilation version stored in the metadata, in the format "vA.B[.X]". A, B, and X are decimal numbers that correspond to the major version, the minor version, and the build number. The length of this string is limited to MAX_PATH.
This output matches the directory name for the .NET Framework version, as it appears under C:\Windows\Microsoft.NET\Framework.
Example values are "v1.0.3705", "v1.1.4322", "v2.0.50727", and "v4.0.X", where X depends on the build number installed. Note that the "v" prefix is required.
[in, out] The size of
pwzbuffer to avoid buffer overruns.
This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.
|S_OK||The method completed successfully.|
|HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)||The buffer is too small.|
Platforms: See System Requirements.
Library: Included as a resource in MSCorEE.dll
.NET Framework Versions: Available since 4