Determine highest .NET Framework version [duplicate]

我是研究僧i 提交于 2019-11-29 03:44:46
chills42

Use the Windows Registry location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP.

Registry keys for the .NET Framework start like this:

HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\

Depending on the version, the rest of the key will be different (check this page).

You can look up how to access the registry in MSDN article Using the registry in a C++ application.

If you're trying to do this from managed code, take a look at this article, which wraps all of the logic needed to determine if a specific Framework version is installed.

Otherwise, take a look at Aaron's blog post here, which gives a C/C++ method for doing the same thing.

leppie

The following is supposed to give you the answer, but it seems horribly broken :(

c:\Program Files>clrver
Versions installed on the machine:
v2.0.50727
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!