How do I find the .NET version?
How do I find out which version of .NET is installed?
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.
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
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.NETFrameworkv?.*
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.
Another three options from the PowerShell command prompt is given below.
6. [environment]::Version
7. $PSVersionTable.CLRVersion
8. gci 'HKLM:SOFTWAREMicrosoftNET Framework SetupNDP' -recurse | gp -name Version,Release -EA 0 |
where { $_.PSChildName -match '^(?!S)p{L}'} | select PSChildName, Version, Release
The last command (8) will give you all versions, including .NET 4.5.
There is an easier way to get the exact version .NET version installed on your machine from a cmd prompt. Just follow the following instructions;
reg query "HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDP"
(This will list all the .NET versions.)
reg query "HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4full" /v version
Please find the attached image below to see how it is shown.
.NET版本检测器是一个GUI实用程序,显示安装了该框架的六个(!)版本中的哪一个。
链接地址: http://www.djcxy.com/p/29078.html上一篇: .NET 2.0框架的最低版本支持Powershell 2.0?
下一篇: 我如何找到.NET版本?