[英]Running different code depending on what Net Framework version is installed
如果安装了Net Framework 3.5,是否可以使用普通LINQ运行LINQ方法,但如果安装了4.0或更高版本,则使用PLINQ?
I don't think that's possible. 我不认为这是可能的。 Here are some alternatives:
以下是一些替代方案:
#if
directives. #if
指令制作项目的两个不同版本。 While i also don't think its wise to code two versions you can use the Environment.Version variable. 虽然我也不认为编写两个版本是明智的,但您可以使用Environment.Version变量。
It is there in all .net versions since 1.1 and Silverlight. 它存在于自1.1和Silverlight以来的所有.net版本中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.