判断生产 Windows Server 上安装了哪些 .NET 版本的万无一失的方法是什么? [英] What's the foolproof way to tell which version(s) of .NET are installed on a production Windows Server?

查看:29
本文介绍了判断生产 Windows Server 上安装了哪些 .NET 版本的万无一失的方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题与其说是编程相关,不如说是部署相关.

This question is not so much programming related as it is deployment related.

我发现自己与公司中的团队进行了很多交谈,他们的工作是维护我们的生产 Windows 服务器并在其上部署我们的代码.出于法律和合规性原因,我对服务器没有直接的可见性或任何控制权,因此我可以通过我向该组提供的指示来判断其中任何一个上安装了哪些版本的 .NET.

I find myself conversing a lot with the group in my company whose job it is to maintain our production Windows servers and deploy our code on them. For legal and compliance reasons, I do not have direct visibility or any control over the servers so the only way I can tell which version(s) of .NET are installed on any of them is through directions I give to that group.

到目前为止,我能想到的所有方法来判断安装了哪些版本(检查与 1.1 或 2.0 匹配的管理工具,检查添加/删除程序"列表中的条目,检查c:WindowsMicrosoft.NET 下目录的存在是有缺陷的(我已经看到至少一台机器有 2.0 但在管理工具下没有 2.0 条目 - 该方法没有告诉你关于 3.0+,添加/删除程序"列表可能与现实不同步,目录的存在并不一定意味着什么).

So far, all of the methods I can think of to tell which version(s) are installed (check for Administrative Tools matching 1.1 or 2.0, check for the entries in the "Add/Remove Programs" list, check for the existence of the directories under c:WindowsMicrosoft.NET) are flawed (I've seen at least one machine with 2.0 but no 2.0 entries under Administrative Tools - and that method tells you nothing about 3.0+, the "Add/Remove Programs" list can get out of sync with reality, and the existence of the directories doesn't necessarily mean anything).

鉴于我通常需要提前知道这些东西是否到位(发现哎呀,这个没有您需要的所有版本和服务包"在较短的维护窗口中并不能很好地工作)和我必须通过代理"进行检查,因为我无法直接访问服务器,判断生产 Windows Server 上安装了哪些 .NET 版本的万无一失的方法是什么?最好是使用框架安装的一些内在方法来做到这一点,因为它会更快并且不需要加载某种实用程序,而且如果框架没有正确安装但仍然有文件,方法肯定会失败(即,那里有一个目录和 gacutil.exe,但该版本的框架并没有真正安装")

Given that I generally need to know these things are in place in advance (discovering that "oops, this one doesn't have all the versions and service packs you need" doesn't really work well with short maintenance windows) and I have to do the checking "by proxy" since I can't get on the servers directly, what's the foolproof way to tell which version(s) of .NET are installed on a production Windows Server? Preferably some intrinsic way to do so using what the framework installs since it will be quicker and not need some sort of utility to be loaded and also a method which will definitely fail if the frameworks are not properly installed but still have files in place (i.e., there's a directory and gacutil.exe is inded there but that version of the framework is not really "installed")

在框架中没有一个很好的万无一失的内在方法来做到这一点,有没有人知道一个好的,轻量级的,不需要安装的程序,可以找到这出?我可以想象有人可以很容易地写一个,但如果一个已经存在,那就更好了.

In the absence of a good foolproof intrinsic way to do this built into the Framework(s), does anyone know of a good, lightweight, no-install-required program that can find this out? I can imagine someone could easily write one but if one already exists, that would be even better.

推荐答案

您应该在要查找此信息的服务器上打开 IE,然后访问此站点:http://www.hanselman.com/smallestdotnet/

You should open up IE on the server for which you are looking for this info, and go to this site: http://www.hanselman.com/smallestdotnet/

仅此而已.

该站点有一个脚本,可以查看您浏览器的UserAgent"并找出您已安装(或未安装)的 .NET Framework 版本(如果有),并自动显示(然后计算总大小)如果您选择下载 .NET Framework).

The site has a script that looks your browser's "UserAgent" and figures out what version (if any) of the .NET Framework you have (or don't have) installed, and displays it automatically (then calculates the total size if you chose to download the .NET Framework).

这篇关于判断生产 Windows Server 上安装了哪些 .NET 版本的万无一失的方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆