Check the .Net Framework Version

Your system may have multiple versions of the .Net Framework installed side-by-side.

For troubleshooting purposes, it’s sometimes helpful to get an overview of the .Net Framework versions installed on your system.

Use the following PowerShell script to list all .Net Framework versions installed on your system.

Check the .Net Framework Versions Using PowerShell

Use the following script to see all .Net Framework versions installed on your system:

# Check the .Net Framework versions on your system.
# Output is stored in a PSObject ($NetFwks) for your convenience.
# Feel free to edit/distribute the script,
# but please retain this header.
#
# Easy365Manager - the Office 365 management tool for Active Directory.
#
# https://Easy365Manager.com

$NetFwks = @()
# Get .Net Framework versions earlier than 4.5
$NetFwkPre45 = Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\"
ForEach($NetFwk In $NetFwkPre45){
    If ($NetFwk.PSChildName.Substring(0,1) -eq "v" -and $NetFwk.PSChildName -ne "v4"){
        $Version = $NetFwk.GetValue("Version")
        If ($null -ne $Version){
            $SP = $NetFwk.GetValue("SP")
        }
        Else {
            ForEach ($SubKey In (Get-ChildItem $NetFwk.Name.Replace("HKEY_LOCAL_MACHINE", "HKLM:"))){
                $Version = $SubKey.GetValue("Version")
                If ($null -ne $Version){
                    $SP = $SubKey.GetValue("SP")
                    Break
                }
            }
        }        
        $obj = New-Object PSObject -Property @{
            Version     = $Version
            ServicePack = $SP
        }
        $NetFwks += $obj
    }
}
# Get .Net Framework versions 4.5 and later
$NetFwk45 = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" -ErrorAction SilentlyContinue
If ($null -ne $NetFwk45){
    $Version = $NetFwk45.Version
    $Release = $NetFwk45.Release
    If ($null -eq $Version -and $null -ne $Release){
        if ($Release -ge 528040) {$Version = "4.8 or later"}
        elseif ($Release -ge 461808) {$Version = "4.7.2"}
        elseif ($Release -ge 461308) {$Version = "4.7.1"}
        elseif ($Release -ge 460798) {$Version = "4.7"}
        elseif ($Release -ge 394802) {$Version = "4.6.2"}
        elseif ($Release -ge 394254) {$Version = "4.6.1"}
        elseif ($Release -ge 393295) {$Version = "4.6"}
        elseif ($Release -ge 379893) {$Version = "4.5.2"}
        elseif ($Release -ge 378675) {$Version = "4.5.1"}
        elseif ($Release -ge 378389) {$Version = "4.5"}
    }
    $obj = New-Object PSObject -Property @{
        Version = $Version
    }
    $NetFwks += $obj
}
$NetFwks | ft Version,ServicePack -AutoSize

The output from the script may look similar to the following:

Version        ServicePack
-------        -----------
2.0.50727.4927           2
3.0.30729.4926           2
3.5.30729.4926           1
4.0.0.0
4.8.04084

As the output is stored inside a PSObject ($NetFwks) you can use it programmatically, e.g.:

PS C:\> $NetFwks | % { Write-Host .Net Framework version $_.Version.SubString(0,3) is installed on your system. }

.Net Framework version 2.0 is installed on your system.
.Net Framework version 3.0 is installed on your system.
.Net Framework version 3.5 is installed on your system.
.Net Framework version 4.0 is installed on your system.
.Net Framework version 4.8 is installed on your system.

Check the .Net Framework Versions Using the Registry

You can check the .Net Framework directly from the registry, but it’s a bit tedious.

You must review multiple registry keys to check which versions of the .Net Framework are installed on your system.

.Net Framework versions earlier than version 4.5 are listed as sub-keys in the following registry hive:

HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\

Depending on the versions installed, you may see something like this:

How to find the .Net Frarmework versions installed on your system in the registry.

.Net Framework versions 4.5 and later are listed in the following registry hive:

HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\

Depending on the versions installed you may see something like this:

How to find the .Net Frarmework versions installed on your system in the registry.

You’ll typically see the complete version information listed in the Version property.

In case the Version property is missing, then you can calculate the version from the Release property:

.NET Framework versionMinimum value
.NET Framework 4.8.1533325
.NET Framework 4.8528040
.NET Framework 4.7.2461808
.NET Framework 4.7.1461308
.NET Framework 4.7460798
.NET Framework 4.6.2394802
.NET Framework 4.6.1394254
.NET Framework 4.6393295
.NET Framework 4.5.2379893
.NET Framework 4.5.1378675
.NET Framework 4.5378389

(source: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed)