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

查看:110
本文介绍了如何找到.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 Command提示符下运行它们:安装了Visual Studio,或者如果已安装.NET Framework SDK,则显示SDK命令提示符。

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除外),最新首先
您需要运行第4条命令来查看是否已安装.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版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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