Get full list of .NET framework version installed
Asked Answered
C

3

5

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)?

Cowan answered 10/4, 2013 at 11:6 Comment(2)
How to: Determine Which .NET Framework Versions Are InstalledBeffrey
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.Roast
P
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/

Piquet answered 10/4, 2013 at 11:13 Comment(1)
Thank, I use those links to get my answer:Cowan
C
3

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....

Cowan answered 10/4, 2013 at 12:47 Comment(0)
S
3

You can use the command dotnet --list-sdks in the terminal to list all installed sdks.

https://learn.microsoft.com/en-us/dotnet/core/install/how-to-detect-installed-versions?pivots=os-windows

2.1.701 [C:\Program Files\dotnet\sdk]
3.0.100-preview5-011568 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
6.0.401 [C:\Program Files\dotnet\sdk]
7.0.100-preview.6.22352.1 [C:\Program Files\dotnet\sdk]
7.0.100-rc.1.22431.12 [C:\Program Files\dotnet\sdk]

The command dotnet --list-runtimes will list the installed runtimes.

Squelch answered 30/10, 2022 at 12:31 Comment(1)
this is just for dotNet. It does not list framework versions.Eula
P
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/

Piquet answered 10/4, 2013 at 11:13 Comment(1)
Thank, I use those links to get my answer:Cowan

© 2022 - 2024 — McMap. All rights reserved.