How to determine the version of .NET on which the application is running?

I tried using Environment.Version.ToString() to determine which .NET platform on the target computer is being used, but it says that I am using .NET 2.0 when version 4.0 is installed.

How to determine which version of the .NET Framework is running on the target machine?

+4
source share
2 answers

Environment.Version.ToString(); returns the version of your application, not the system, you can read the version from the registry or search the folders% windows% \ Microsoft.NET \ Framework to find the maximum number.

The registry key is HKLM\Software\Microsoft\NET Framework Setup\NDP\ see How to determine which versions and service packs of the .NET Framework are installed?

+5
source

To find out which versions of .NET are available on your computer, you need to look in the registry - see http://msdn.microsoft.com/en-us/kb/kbarticle.aspx?id=318785 .

+1
source

Source: https://habr.com/ru/post/1333711/


All Articles