Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. How can I tell what version of .NET is installed?

How can I tell what version of .NET is installed?

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncsharpdotnetwindows-adminannouncement
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EnkelIk
    wrote on last edited by
    #1

    If I programmatiacally want to determine whether .NET framework is installed on a computer and if so what version of .NET, how do I do this? The project can not use .NET naturally since it also has to run on computers where .NET has not yet been installed. I've looked in the registry and found that I can use "RegOpenKeyEx()" on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0", but there must be a better way, since this call will fail if the user is running v1.1 . So how can I decide if and what version of .NET is installed on a computer? Regards /EnkelIk

    E S C 3 Replies Last reply
    0
    • E EnkelIk

      If I programmatiacally want to determine whether .NET framework is installed on a computer and if so what version of .NET, how do I do this? The project can not use .NET naturally since it also has to run on computers where .NET has not yet been installed. I've looked in the registry and found that I can use "RegOpenKeyEx()" on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0", but there must be a better way, since this call will fail if the user is running v1.1 . So how can I decide if and what version of .NET is installed on a computer? Regards /EnkelIk

      E Offline
      E Offline
      ez2
      wrote on last edited by
      #2

      If you app is being accessed or downloaded from the web, you can check the user agent of the request object. .Net adds the clr and version number to the user agent. Check out http://www.asp.net/webmatrix/download.aspx?tabindex=4 download section which uses the user agent to detect whether or not .net is installed. It's quick and simple. Hope this helps.

      1 Reply Last reply
      0
      • E EnkelIk

        If I programmatiacally want to determine whether .NET framework is installed on a computer and if so what version of .NET, how do I do this? The project can not use .NET naturally since it also has to run on computers where .NET has not yet been installed. I've looked in the registry and found that I can use "RegOpenKeyEx()" on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0", but there must be a better way, since this call will fail if the user is running v1.1 . So how can I decide if and what version of .NET is installed on a computer? Regards /EnkelIk

        S Offline
        S Offline
        Stephane Rodriguez
        wrote on last edited by
        #3

        On the client-side, check out whether mscoree.dll exists (it's in <winsysdir>). That's the first thing a .NET app loads (to host the CLR). Regarding the .NET version, you can lookup the registry : HKLM\Software\Microsoft\NET Framework Setup\Product\xxx with values defined as for instance : Package="Full" ProductLanguage="1033" Version="v1.0.3705" Version is like this 1 : major 0 : minor 3705 : build


        She's so dirty, she threw a boomerang and it wouldn't even come back.

        1 Reply Last reply
        0
        • E EnkelIk

          If I programmatiacally want to determine whether .NET framework is installed on a computer and if so what version of .NET, how do I do this? The project can not use .NET naturally since it also has to run on computers where .NET has not yet been installed. I've looked in the registry and found that I can use "RegOpenKeyEx()" on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0", but there must be a better way, since this call will fail if the user is running v1.1 . So how can I decide if and what version of .NET is installed on a computer? Regards /EnkelIk

          C Offline
          C Offline
          Christian Tratz
          wrote on last edited by
          #4

          You could also check the for the existence of the path: %windir%\Microsoft.NET\Framework\v1.0.3705 Ragards Chris

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups