Jul 6, 2011

Which .NET version a running program is using?


I was asked a question by a colleague:
He has many .NET framework installed on machine. Once he has a program running on the system, what he knows is that program is a .NET developed program, and he would like to further identify which .NET version the program is using.

I didn't know the answer, but today I read 《CLR via C#》, I got the answer:

1, go to registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
You will know what versions of .NET Framework is installed on the machine.
2, go to any .NET Framework SDK,

If you have Visual Studio installed on your computer: On the taskbar, click Start, click All Programs, click Visual Studio, click Visual Studio Tools, and then click Visual Studio Command Prompt.

-or-

If you have the Windows SDK installed on your computer: On the taskbar, click Start, click All Programs, click the folder for the Windows SDK, and then click Command Prompt (or CMD Shell).


for example in Visual Studio 2010 prompt, which might be
C:\Program Files\Microsoft Visual Studio 10.0\VC;
3, CLRVer.exe -all
This command can show which version of the CLR is being used by processes running ont he machine or you can pass the ID of the processs you are interested in.

Keep reading...

Jul 4, 2011

g2m3 Codec - Windows Media Player

Today I was trying to watch a WMV file, but it prompts an error: G2M3 codec is not installed on your desk. The WMV file is a meeting recording, and seems to be using G2M3 codec, which is a plugin for Windows Media Player. To solve this, download installer from http://championsriver.com/g2m_codec.exe, and install it.