[英]Detect framework version 3.5
I'm developing an XBAP (Partial trust) application, with multiple (~100) users. 我正在开发一个具有多个(〜100)用户的XBAP(部分信任)应用程序。
In the next version the prerequisites have been bumped from framework 3.0 to framework 3.5, and we need an easy way to detect the framework version of each client machine, and advise them on whether they need to upgrade or not. 在下一版本中,先决条件已从框架3.0变为框架3.5,我们需要一种简单的方法来检测每台客户端计算机的框架版本,并就是否需要升级提供建议。
Any ideas or suggestions on how to do this? 有关如何执行此操作的任何想法或建议?
This is going to depend on when and where you are going to be distributing. 这将取决于您将在何时何地进行分发。 If they are going to be downloading the application you can use this route to setup an ASP.NET page to warn them and even prevent download until they install it.
如果他们要下载该应用程序,则可以使用此路由来设置ASP.NET页来警告他们,甚至阻止下载,直到他们安装它为止。
Otherwise, you would need to look at the registry on the users machine to determine if they have the proper versions. 否则,您将需要查看用户计算机上的注册表,以确定他们是否具有正确的版本。 There is another SO question that covers this " How to detect what .NET Framework Version is Installed? "
还有另一个SO问题涵盖此问题:“ 如何检测安装了什么.NET Framework版本? ”
Have you considered Environment.Version
您是否考虑过
Environment.Version
int buildVersion = Environment.Version.Build;
int majorVersion = Environment.Version.Major;
int minorVerdion = Environment.Version.Minor;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.