Best Way To Determine If .NET 3.5 Is Installed

前端 未结 9 1590
时光取名叫无心
时光取名叫无心 2021-02-05 12:43

I need to programatically determine whether .NET 3.5 is installed. I thought it would be easy:

<% Response.Write(Environment.Version.ToString()); %>
         


        
9条回答
  •  既然无缘
    2021-02-05 13:43

    One option is to detect 4.0 using the version string:

        Environment.Version.CompareTo(new Version(4, 0));
    

    then since 2.0 and 2.5 share a CLR version number, these need to be distenguished by checking the registry. Since those versions are released already, the strings to look for are known.

提交回复
热议问题