Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find out if .NET 4.02 is installed?

Tags:

.net

.net-4.0

I've asked this question yesterday - it was closed as "exact duplicate" by some people who didn't take the time themselves to read questions / comments carefully! So, another try - maybe it gets the time to receive some working answer before being closed for some pointless reason again.

Microsoft has recently released some "update" for .NET Framework. Unfortunately, I don't know any way to find out which version is installed. Framework-Version stays on 4.0.30319.239.

Thanks for some enlightement ;-)

PS: Setting supportedRuntime in app.config to Version=4.0.2 makes the application tell me at startup that 4.0.2 is not installed (in no time - so there must be some place where the "real" version can be found).

like image 496
Sascha Avatar asked Nov 09 '11 12:11

Sascha


People also ask

How do I know if .NET is installed or not?

The version of .NET Framework (4.5 and later) installed on a machine is listed in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. If the Full subkey is missing, then .NET Framework 4.5 or above isn't installed.

How do you check if .NET 4.7 is installed?

Open Start. Search for Command Prompt, right-click the top result, and select the Run as administrator option. Type the following command to determine the version of . NET installed and press Enter: reg query "HKLM\SOFTWARE\Microsoft\Net Framework Setup\NDP" /s.


2 Answers

Have a look at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs

If you have installed 4.0.2 then there exist these additional nodes:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1,Profile=Client
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2,Profile=Client
like image 65
springy76 Avatar answered Oct 08 '22 12:10

springy76


This shouldn't make a difference. You don't target specific build numbers of the framework, you target the release number, which in this case is 4.0. What are you doing where you need to know the exact build number?

WTF - why use buildcounters?!

Why wouldn't you? It details the exact version of the framework. Typically you don't release software with a round "this is version 1.0.0.0" because it can cause havoc with versioning for updates/hotfixes etc.

Simply targeting .NET 4.0 should be sufficient.

like image 32
Matthew Abbott Avatar answered Oct 08 '22 10:10

Matthew Abbott