Please tell me the method (s) of checking the presence of installed versions of the .NET Framework in the system, and some reliable method (s) of checking their correct functioning.

In particular, verification of version 2.0 for Windows10-x64 is very much needed.

So far I have found several examples on the network on VBS (like this ), but it's difficult to call them tests - there is a simple check of registry keys. I would like something more substantial.

About "more substantial" verification

We need a program that consistently makes calls from .NET (according to versions), and if for some reason calls end with an error, this should be displayed in the results.

A simple example. .NET 3.5 is installed, but one of the dynamic libraries has been removed - let the virus work, for example. In fact, there are directories, and everything is written in the registry - but the performance has been broken. I call this check "more substantial".

  • I would like something more substantial. - eg? - Grundy
  • Suppose a program that consistently makes calls from .NET (according to versions), and if for some reason calls end with an error, this should be displayed in the results. A simple example: .NET 3.5 is installed, but one of the dynamic libraries has been removed - let the virus work, for example. In fact, there are directories, and everything is written in the registry - but the performance has been broken. I call this test “more substantial” - Majestio
  • it's worth adding this description to the question itself - Grundy
  • Description added - Majestio

1 answer 1

Microsoft itself recommends (at least there is an article on MSDN on this), as one of the options, look in the registry.

To find .NET Framework versions by viewing the registry (.NET Framework 1-4)

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ NET Framework Setup \ NDP


To find the .NET Framework version by the registry (.NET Framework 4.5 and later)

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ NET Framework Setup \ NDP \ v4 \ Full

you can check it either through regedit.exe or cmd, for example

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP" | findstr "v2.0*" 

will issue:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ NET Framework Setup \ NDP \ v2.0.50727

Well, either through the code, as in your version or as described in the article with MSDN


UPD

Assemblies are in the GAC along the path% windir% \ assembly for .NET <4. You can try to check them by name, for example. But why?