I need to determine programmatically (c#) if a certain .NET Desktop Runtime version is installed on the system.
One option that I found was to check the version in the registry like this post suggests. However, this will only retrieve the latest version installed. With ASP.NET Core versions can for example be found in the registry here: SOFTWARE\Microsoft\ASP.NET Core\Shared Framework
System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;
Will only retrieve the version of the framework the application is running on.
The official way seems to be using the command "dotnet --list-runtimes" (documented by Microsoft here). This will require that a cmd process is started from the application.
Is there another possible way of retrieving the currently installed .NET Desktop Runtime versions?
Not a great way but you can check if .NET install folders exist in the system. For .net runtime the install folder is -
C:\program files\dotnet\shared{runtime-type}{version}\
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With