IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact
You are here: Home / How To / How to Check Installed .NET Framework Version

How to Check Installed .NET Framework Version

This is a quick way to check an installed version of .NET Framework (as opposed to .NET Core). This works for any .NET Framework 4.5 or later.

We’re doing this by using a PowerShell script to get the value from the registry and a Python script to quickly match the release number to the associated .NET Framework version. This has been used so many times to get the value quickly on production servers, but use it at your own risk.

Steps

  1. On the server where you want to check the .NET Framework version, open a PowerShell window and run the following script:

    (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release
    
  2. Once you see the value, you can check it using the following Python script to see what version of .NET Framework that number corresponds to.

    #! python3
    # Check .NET version based on the release number
    # Reference https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
    releaseVersion = input("\nEnter .NET release number: ")
    def checkVersion(release):
        relNo = int(release)
        if relNo >= 528040:
            print('.NET Framework 4.8')
        elif relNo >= 461808:
            print('.NET Framework 4.7.2')
        elif relNo >= 461308:
            print('.NET Framework 4.7.1')
        elif relNo >= 460798:
            print('.NET Framework 4.7')
        elif relNo >= 394802:
            print('.NET Framework 4.6.2')
        elif relNo >= 394254:
            print('.NET Framework 4.6.1')
        elif relNo >= 393295:
            print('.NET Framework 4.6')
        elif relNo >= 379893:
            print('.NET Framework 4.5.2')
        elif relNo >= 378675:
            print('.NET Framework 4.5.1')
        elif relNo >= 378389:
            print('.NET Framework 4.5')
        else:
            print('No match')
    checkVersion(releaseVersion)
    

I’m sure there’s a more elegant way to do this by just running one script to do all these things but this is provided as it is.

Further Reading

How to Check Installed .NET Core Version
How to: Determine which .NET Framework versions are installed
How to Install Python on Windows Server

April 12, 2022 Filed Under: How To Tagged With: .NET, PowerShell, Python

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to Check Installed .NET Framework Version
  • How to Remove .NET Runtime and SDK on Mac
  • How to Solve Intermittent 403 Error in IIS
  • How to Show Hidden Folders and Files in Mac Finder
  • How to Solve MS Office VBA Compile Error UserAuthentication

Recent Posts

  • How to Check Installed .NET Framework Version
  • How to Remove .NET Runtime and SDK on Mac
  • How to Solve Intermittent 403 Error in IIS
  • How to Show Hidden Folders and Files in Mac Finder
  • How to Solve MS Office VBA Compile Error UserAuthentication
  • RSS

Tags

.NET Access AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP Python Simple Mail Transfer Protocol Smtp Server Social Media SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows Server

Copyright © 2011-2022 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure