简体   繁体   中英

Detect framework version 3.5

I'm developing an XBAP (Partial trust) application, with multiple (~100) users.

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.

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.

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? "

Have you considered Environment.Version

  int buildVersion = Environment.Version.Build;
  int majorVersion = Environment.Version.Major;
  int minorVerdion = Environment.Version.Minor;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM