How to verify that the framework is installed in the correct version?

Asked

Viewed 6,086 times

2

Requirements to install the main software: .Net Framework 4.5.1 Service Pack 1 In other words, I am creating a download manager that downloads the correct version of the main software (32 or 64 bits) and the manager itself scans the client’s machine updating the above requirements if necessary. But I’m having trouble checking to see if the framework is installed. Another doubt,this software could be only executable without the client needing to install on his machine?

2 answers

2

Felipe, the version of . Net is registered in a registration key. From . Net 4.5 is registered in the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full in the Shadow release.

You then check if the framework is in the desired version using the registry key classes, checking whether the key exists and whether the Subkey is above the minimum value.

This Microsoft link gives you better information on identifying the version and purchasing the version using C#: https://msdn.microsoft.com/pt-br/library/hh925568(v=vs.110). aspx

2

Open the command prompt as Adm.

 cd C:\Windows\Microsoft.NET\Framework64
 dir

you will see the installed versions enter the last one and type msbuild -version: example:

 cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
 msbuild -version

done... you will see the latest installed version. inserir a descrição da imagem aqui

for . net core

 dotnet --version

versão .net core

Browser other questions tagged

You are not signed in. Login or sign up in order to post.