Running different code depending on which version of Net Framework is installed

Is it possible to run the LINQ method using regular LINQ if Net Framework 3.5 is installed, but PLINQ is used instead if 4.0 or higher is installed?

+3
source share
2 answers

I do not think that's possible. Here are a few alternatives:

  • If this is an option at all, it would be much easier to require your users to upgrade to .NET 4.0.
  • If you cannot demand updates from your users, you can spend a little more time improving the .NET 3.5 code so that you do not need to create a special version of .NET 4.0.
  • , #if.
+2

, , Environment.Version.

.net 1.1 Silverlight.

0

Source: https://habr.com/ru/post/1772305/


All Articles