简体   繁体   English

检测框架版本3.5

[英]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.

相关问题 我应该在C#程序中使用.NET Framework 3.5检测Windows 8.1的正确操作系统版本? - What should I do in my C# program to detect the correct OS version for Windows 8.1, using .NET Framework 3.5? 在应用程序运行时检测框架版本 - Detect framework version at application runtime 在编译时检测目标框架版本 - Detect target framework version at compile time 如何将.Net Framework从版本3.5更改为版本4.0 - How do I change the .Net Framework from version 3.5 to version 4.0 .NEt 3.5中的版本解析 - Version Parse in .NEt 3.5 VS2010将资源文件引用更改为版本4.0,但目标是3.5 Framework - VS2010 changes resource file references to Version 4.0 although targeting 3.5 Framework Visual Studio 2010 +目标框架3.5。 将使用什么版本的c#编译器? - Visual Studio 2010 + Target Framework 3.5. What version of c# compiler will be used? .NET Framework 2.0 vs 3.5 / 4.0 ...使用旧版本有任何可能的优势吗? - .NET Framework 2.0 vs 3.5/4.0… any possible advantage to use the older version? 由于引用了针对.Net Framework 3.5的程序集,因此无法加载文件或程序集版本为2.0.5.0的系统 - Could not load file or assembly System, Version=2.0.5.0 due to the referenced assembly targeting .Net Framework 3.5 实体框架3.5或4.0? - Entity Framework 3.5 or 4.0?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM