《CLR Via C#》 如何查看计算机是否安装了.NET Framework及其版本

一、 如何查看计算机有没有安装.NET Framework呢?

You can tell if the .NET Framework has been installed by looking for the MSCorEE.dll file in the %SystemRoot%\System32 directory. The existence of this file tells you that the .NET Framework is installed.

《CLR Via C#》 如何查看计算机是否安装了.NET Framework及其版本


二、如何查看计算机上都安装了哪些版本的.NET Framework?

However, several versions of the .NET Framework can be installed on a single machine simultaneously【多个.NET Framework版本可以并存】. If you want to determine exactly which versions of the .NET Framework are installed, examine the subdirectories under the following directories.【在以下位置可以查看.NET Framework版本信息】

%SystemRoot%\Microsoft.NET\Framework 

%SystemRoot%\Microsoft.NET\Framework64

《CLR Via C#》 如何查看计算机是否安装了.NET Framework及其版本


《CLR Via C#》 如何查看计算机是否安装了.NET Framework及其版本

The .NET Framework SDK includes a command-line utility called CLRVer.exe that shows all of the CLR versions installed on a machine【查看.NET Framework版本的另一种方式:CLRVer.exe】. This utility can also show which version of the CLR is being used by processes currently running on the machine by using the –all switch or passing the ID of the process you are interested in.

C:\ProgramFiles (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64下找到了CLRVer.exe文件。

《CLR Via C#》 如何查看计算机是否安装了.NET Framework及其版本