Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running different code depending on what Net Framework version is installed

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

like image 609
Michael Low Avatar asked Jul 29 '26 03:07

Michael Low


1 Answers

I don't think that's possible. Here are some alternatives:

  • If it is at all an option it would be much simpler to require your users to upgrade to .NET 4.0.
  • If you can't require your users to upgrade you can spend a little more time improving the .NET 3.5 code so that you don't need to make a special .NET 4.0 version.
  • Or you can make two different builds of your project using #if directives.
like image 113
Mark Byers Avatar answered Jul 30 '26 18:07

Mark Byers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!