.Net: How do I find the .NET version?

后端 未结 19 2379
我寻月下人不归
我寻月下人不归 2020-11-28 00:49

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

相关标签:
19条回答
  • 2020-11-28 01:12

    My god, so much mess to find version of installed .net framework?

    Windows > Search > Visual Studio Installer > for installed version of VS, tap on More > Modify > Individual Components and see it there:

    0 讨论(0)
  • 2020-11-28 01:12

    If you do this fairly frequently (as I tend to do) you can create a shortcut on your desktop as follows:

    1. Right click on the desktop and select NewShortcut.
    2. In the location field, paste this string: powershell.exe -noexit -command "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" (this is from Binoj Antony's post).
    3. Hit Next. Give the shortcut a name and Finish.

    (NOTE: I am not sure if this works for 4.5, but I can confirm that it does work for 4.6, and versions prior to 4.5.)

    0 讨论(0)
  • 2020-11-28 01:12

    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;

    Open the command prompt (i.e Windows + R → type “cmd”) and type the following command, all on one line: %windir%\Microsoft.NET\FrameWork, and then navigating to the directory with the latest version number.

    Refer to http://dotnettec.com/check-dot-net-framework-version/

    0 讨论(0)
  • 2020-11-28 01:13

    To just get the installed version(s) at the command line, I recommend using net-version.

    • It's just a single binary.
    • It uses the guidelines provided my Microsoft to get version information.
    • It doesn't require the SDK to be installed.
    • Or the Visual Studio command prompt.
    • It doesn't require you to use regedit and hunt down registry keys yourself. You can even pipe the output in a command line tool if you need to.

    Source code is available on github.com

    Full disclosure: I created this tool myself out of frustration.

    0 讨论(0)
  • 2020-11-28 01:17

    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.NET\Framework\v?.*
    

    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:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -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.

    0 讨论(0)
  • 2020-11-28 01:19

    Just type the following in the command line:

    dir /b /ad /o-n %systemroot%\Microsoft.NET\Framework\v?.*
    

    Your dotnet version will be shown as the highest number.

    0 讨论(0)
提交回复
热议问题