我怎样才能以编程方式检测ASP.NET 3.5?

时间:2022-09-29 07:18:03

I am creating a diagnostic page for ASP.NET and would like to programatically detect if ASP.NET 3.5 has been installed on the server. Any ideas on how to best do this?

我正在为ASP.NET创建一个诊断页面,并希望以编程方式检测服务器上是否安装了ASP.NET 3.5。关于如何做到这一点的任何想法?

1 个解决方案

#1


System.Environment.Version gives you the CLR version.
For ASP.NET 2.0, 3.0 and 3.5 it will return the same CLR version: 2.0.50727.3053
As for ASP.NET 4.0 the CLR version will change to 4.*

System.Environment.Version为您提供CLR版本。对于ASP.NET 2.0,3.0和3.5,它将返回相同的CLR版本:2.0.50727.3053对于ASP.NET 4.0,CLR版本将更改为4. *

#1


System.Environment.Version gives you the CLR version.
For ASP.NET 2.0, 3.0 and 3.5 it will return the same CLR version: 2.0.50727.3053
As for ASP.NET 4.0 the CLR version will change to 4.*

System.Environment.Version为您提供CLR版本。对于ASP.NET 2.0,3.0和3.5,它将返回相同的CLR版本:2.0.50727.3053对于ASP.NET 4.0,CLR版本将更改为4. *