How to: Determine which .NET Framework security updates and hotfixes are installed

This article shows you how to find out which .NET Framework security updates and hotfixes are installed on a computer.

Note

All the techniques shown in this article require an account with administrative privileges.

To find installed updates using the registry

The installed security updates and hotfixes for each version of the .NET Framework installed on a computer are listed in the Windows registry. You can use the Registry Editor (regedit.exe) program to view this information.

  1. Open the program regedit.exe. In Windows 8 and later versions, right-click Start Windows logo, then select Run. In the Open box, enter regedit and select OK.

  2. In the Registry Editor, open the following subkey:

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Updates

    The installed updates are listed under subkeys that identify the .NET Framework version they apply to. Each update is identified by a Knowledge Base (KB) number.

In the Registry Editor, the .NET Framework versions and installed updates for each version are stored in different subkeys. For information about detecting the installed version numbers, see How to: Determine which .NET Framework versions are installed.

To find installed updates by querying the registry in code

The following example programmatically determines the .NET Framework security updates and hotfixes that are installed on a computer:

using System;
using Microsoft.Win32;

public class GetUpdateHistory
{
    public static void Main()
    {
        using (RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(@"SOFTWARE\Microsoft\Updates"))
        {
            foreach (string baseKeyName in baseKey.GetSubKeyNames())
            {
                if (baseKeyName.Contains(".NET Framework"))
                {
                    using (RegistryKey updateKey = baseKey.OpenSubKey(baseKeyName))
                    {
                        Console.WriteLine(baseKeyName);
                        foreach (string kbKeyName in updateKey.GetSubKeyNames())
                        {
                            using (RegistryKey kbKey = updateKey.OpenSubKey(kbKeyName))
                            {
                                Console.WriteLine("  " + kbKeyName);
                            }
                        }
                    }
                }
            }
        }
    }
}

Imports Microsoft.Win32

Public Class GetUpdateHistory
    Public Shared Sub Main()
        Using baseKey As RegistryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey("SOFTWARE\Microsoft\Updates")
            For Each baseKeyName As String In baseKey.GetSubKeyNames()
                If baseKeyName.Contains(".NET Framework") Then
                    Using updateKey As RegistryKey = baseKey.OpenSubKey(baseKeyName)
                        Console.WriteLine(baseKeyName)
                        For Each kbKeyName As String In updateKey.GetSubKeyNames()
                            Using kbKey As RegistryKey = updateKey.OpenSubKey(kbKeyName)
                                Console.WriteLine("  " & kbKeyName)
                            End Using
                        Next
                    End Using
                End If
            Next
        End Using
    End Sub
End Class

The example produces an output that's similar to the following one:

Microsoft .NET Framework 4 Client Profile
  KB2468871
  KB2468871v2
  KB2478063
  KB2533523
  KB2544514
  KB2600211
  KB2600217
Microsoft .NET Framework 4 Extended
  KB2468871
  KB2468871v2
  KB2478063
  KB2533523
  KB2544514
  KB2600211
  KB2600217

To find installed updates by querying the registry in PowerShell

The following example shows how to determine the .NET Framework security updates and hotfixes that are installed on a computer using PowerShell:

$DotNetVersions = Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Updates | Where-Object {$_.name -like
 "*.NET Framework*"}

ForEach($Version in $DotNetVersions){

   $Updates = Get-ChildItem $Version.PSPath
    $Version.PSChildName
    ForEach ($Update in $Updates){
       $Update.PSChildName
       }
}

The example produces an output that's similar to the following one:

Microsoft .NET Framework 4 Client Profile
KB2468871
KB2468871v2
KB2478063
KB2533523
KB2544514
KB2600211
KB2600217
Microsoft .NET Framework 4 Extended
KB2468871
KB2468871v2
KB2478063
KB2533523
KB2544514
KB2600211
KB2600217

See also

How to: Determine which .NET Framework versions are installed
Install the .NET Framework for developers
Versions and dependencies