Monday, October 20, 2008

Detect the .NET Framework 3.5 sp1 from asp.net

After installing NET Framework 3.5 sp1 from asp.net you will still get Request.Browser.ClrVersion.ToString() value is 3.5.21022 its not the latest sp1 version.

therefore better check from Request.Params["HTTP_USER_AGENT"] where you will get all info contain at
SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform

So check your require version using following code

if (Request.Params["HTTP_USER_AGENT"].Contains("NET CLR 3.5.30729")==false)
hasDotNet = false;

1 comments: