1

I need to get the list of all framework versions that are installed in the computer, buy I need the full name, as it is in the Add/Remove programs. Like: "Microsoft .NET Framework 3.5 SP1" or "Microsoft .NET Framework 2.0 Service Pack 2"

is there any way to get that list (in Windows XP and 7)?

jpaugh
  • 6,117
  • 4
  • 36
  • 87
user2254436
  • 453
  • 3
  • 9
  • 24
  • 2
    [`How to: Determine Which .NET Framework Versions Are Installed`](http://msdn.microsoft.com/en-us/library/hh925568.aspx) – Soner Gönül Apr 10 '13 at 11:07
  • Just run the .NET redistributable from your setup by marking it as a prerequisite, please don't mess with .NET installations yourself ... anyway, what have you tried? Look at [this duplicate](http://stackoverflow.com/questions/951856/is-there-an-easy-way-to-check-net-framework-version-using-c). – CodeCaster Apr 10 '13 at 11:07

2 Answers2

2

You can get the framework versions including their names from the Windows Registery

See these links for reference:

Is there an easy way to check the .NET Framework version?

http://www.walkernews.net/2008/05/16/how-to-check-net-framework-version-installed/

Community
  • 1
  • 1
Ali
  • 1,399
  • 12
  • 22
1

Thank, I use those links to get my answer, this was waht I did:

        string path = @"SOFTWARE\Microsoft\NET Framework Setup\NDP";
        List<string> display_framwork_name = new List<string>();

        RegistryKey installed_versions = Registry.LocalMachine.OpenSubKey(path);
        string[] version_names = installed_versions.GetSubKeyNames();

        for (int i = 1; i <= version_names.Length - 1; i++)
        {
            string temp_name = "Microsoft .NET Framework " + version_names[i].ToString() + "  SP" + installed_versions.OpenSubKey(version_names[i]).GetValue("SP");
            display_framwork_name.Add(temp_name);
        }

        return display_framwork_name;

So my output was: "Microsoft .NET Framework v3.5 SP1" "Microsoft .NET Framework v3.0 SP2" and so on....

user2254436
  • 453
  • 3
  • 9
  • 24