.Net:如何找到.NET版本? [英] .Net: How do I find the .NET version?

查看:45
本文介绍了.Net:如何找到.NET版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确定安装了哪个版本的.NET?

How do I find out which version of .NET is installed?

我正在寻找可以在命令提示符下键入的"java -version"之类的简单信息,它告诉我当前安装的版本.

I'm looking for something as simple as "java -version" that I can type at the command prompt and that tells me the current version(s) installed.

我最好补充一点,即可能未安装Visual Studio,这是我通常想了解的有关客户端计算机的信息.

I better add that Visual Studio may not be installed - this is typically something that I want to know about a client machine.

推荐答案

只需键入以下命令中的任何一个,即可在第一行中为您提供最新版本.

Just type any one of the below commands to give you the latest version in the first line.

1. CSC
2. GACUTIL /l ?
3. CLRVER

如果您已安装Visual Studio,则只能从Visual Studio Command提示符下运行它们;否则,如果您具有.NET Framework SDK,则只能在SDK Command提示符下运行.

You can only run these from the Visual Studio Command prompt if you have Visual Studio installed, or else if you have the .NET framework SDK, then the SDK Command prompt.

4. wmic product get description | findstr /C:".NET Framework"
5. dir /b /ad /o-n %systemroot%\Microsoft.NET\Framework\v?.*

最后一个命令(5)将列出安装的.NET的所有版本(4.5除外),最新的.
您需要运行第四条命令查看是否已安装.NET 4.5.

The last command (5) will list out all the versions (except 4.5) of .NET installed, latest first.
You need to run the 4th command to see if .NET 4.5 is installed.

PowerShell命令提示符下的另外三个选项如下.

Another three options from the PowerShell command prompt is given below.

6.   [environment]::Version
7.   $PSVersionTable.CLRVersion
8.   gci 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | gp -name Version,Release -EA 0 |
     where { $_.PSChildName -match '^(?!S)\p{L}'} | select PSChildName, Version, Release

最后一个命令(8)将为您提供所有版本,包括.NET 4.5.

The last command (8) will give you all versions, including .NET 4.5.

这篇关于.Net:如何找到.NET版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆