Best Way To Determine If .NET 3.5 Is Installed

前端 未结 9 1582
时光取名叫无心
时光取名叫无心 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:36

    Without any assembly loading and catching exceptions (which is slow), check for class API changes between 2.0 and 3.5. Mono Class Status is very helpful for this. For example you could check for GC.Collect Method (Int32, GCCollectionMode) which is in mscorlib and was added in 3.5 .

提交回复
热议问题