Is there a way to determine the .NET Framework version from the command line?

前端 未结 7 1010
北海茫月
北海茫月 2020-12-05 04:40

To troubleshoot an installation, sometimes I just want a quick answer to what version of .NET is installed.

Is there a way to determine the .NET Framework version on

7条回答
  •  误落风尘
    2020-12-05 05:24

    Based on your update which indicates this is for walking a non-tech savvy end user through it, I suggest going to Scott Hanselman's site http://www.smallestdotnet.com (use Internet Explorer) which uses the user agent string to tell you which .NET Framework you've got and gives you recommendations for getting up to the latest version in the most efficient manner.

    Old Answer
    With PowerShell you could do this (although the presence of PowerShell already implies at least .NET 2.0)

    Get-ChildItem "$($Env:WinDir)\Microsoft.Net\Framework" -i mscorlib.dll -r |
        ForEach-Object { $_.VersionInfo.ProductVersion }
    

    I don't know if there's a comparable way to get the version information in plain old crusty cmd.exe.

提交回复
热议问题