我如何知道安装了哪个版本的。net ?
我正在寻找一些像java -version一样简单的东西,我可以在命令提示符中键入,并告诉我当前安装的版本。
我最好补充一点,Visual Studio可能不会被安装——这通常是我想知道的关于客户端机器的事情。
我如何知道安装了哪个版本的。net ?
我正在寻找一些像java -version一样简单的东西,我可以在命令提示符中键入,并告诉我当前安装的版本。
我最好补充一点,Visual Studio可能不会被安装——这通常是我想知道的关于客户端机器的事情。
当前回答
微软的powershell:
Get-ChildItem "hklm:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release | % { $_ -ge 394802 }
请参阅此链接的表格,以获取用于搜索特定版本的DWORD值:
https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#ps_a
其他回答
适用于运行Windows 10 1607并寻找。net 4.7的用户。 忽略以上所有。
不在注册表中,c:\ windows \微软NET文件夹或“已安装程序”列表或同一列表的WMIC显示。
查找“已安装的更新”KB3186568。
如果你经常这样做(就像我一样),你可以在桌面上创建一个如下所示的快捷方式:
右键单击桌面,选择新建→快捷方式。 在location字段中,粘贴这个字符串:powershell.exe -noexit -command "gci 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | gp name Version,Release -EA 0 | where{$_。PSChildName -match '^(?!S)\p{L}'} | select PSChildName, Version, Release"(这来自Binoj Antony的帖子)。 点击下一步。为快捷方式指定一个名称并完成。
(注意:我不确定这是否适用于4.5,但我可以确认它适用于4.6,以及4.5之前的版本。)
有一种更简单的方法可以通过cmd提示符在你的机器上安装。net版本。只要按照下面的指示;
打开命令提示符(即Windows + R→键入“cmd”)。 在一行中输入以下命令: reg查询“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP” (这将列出所有的。net版本。) 如果你想查看最新的。net 4版本。 在一行中输入以下指令: reg查询“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\full”/v版本
请找到下面所附的图片,看看它是如何显示的。
MSDN详细介绍了如何从注册表中检查它:
To find .NET Framework versions by viewing the registry (.NET Framework 1-4) On the Start menu, choose Run. In the Open box, enter regedit.exe.You must have administrative credentials to run regedit.exe. In the Registry Editor, open the following subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP The installed versions are listed under the NDP subkey. The version number is stored in the Version entry. For the .NET Framework 4 the Version entry is under the Client or Full subkey (under NDP), or under both subkeys. To find .NET Framework versions by viewing the registry (.NET Framework 4.5 and later) On the Start menu, choose Run. In the Open box, enter regedit.exe. You must have administrative credentials to run regedit.exe. In the Registry Editor, open the following subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full Note that the path to the Full subkey includes the subkey Net Framework rather than .NET Framework Check for a DWORD value named Release. The existence of the Release DWORD indicates that the .NET Framework 4.5 or newer has been installed on that computer.
注意:上面快照中被剪切的最后一行在所有其他操作系统版本上为:461310。我尽我最大的努力避免在截屏时信息被剪切,但表格太大了。
试试Scott Hanselman的. net Checker。