Tuesday, May 5, 2009, 19:42
Posted by Administrator
How to check which .NET version is currently used? Posted by Administrator
Environment.Version will always return "version = {2.0.50727.3082}", because Environment.Version returns the CLR version, NET 3.0 and 3.5 are both build upon 2.0 and still use the 2.0 CLR. They basically just add additionall class libraries. That's why Environment.Version and other APIs return 2.0 to you.
How to check if certain .NET version has been installed?
Kadir Sümerkent has written a nice function that works perfectly till .NET version 3.5.
http://www.sumerkent.com/index.php/2009 ... installed/
How to check if .NET 3.5 SP1 has been installed?
internal static bool IsNET35SP1Installed(){
string Fx35RegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5";
object Fx35ServicePack = Registry.GetValue(Fx35RegistryKey, "SP", null);
if (Fx35ServicePack == null || (int)Fx35ServicePack < 1)
{
return false;
}
return true;
}
How to check if Microsoft Chart Controls has been installed?
internal static bool IsAspChartControlsInstalled()
{
string location = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Microsoft Chart Controls\Assemblies";
DirectoryInfo chartControlsAssembliesDir = new DirectoryInfo(location);
if (!chartControlsAssembliesDir.Exists)
{
return false;
}
else
{
if (chartControlsAssembliesDir.GetFiles().Count() < 6)
{
return false;
}
}
return true;
}
How to check which Culture Info the SQL Server is currently using?
http://tomvangaever.be//blog/comments.p ... 106-122529
Check if current windows server is 2003 R2
http://tomvangaever.be//blog/comments.p ... 404-112005
More to come when we need a new environment check!




( 3 / 604 )

Tom Van Gaever - Blog
Avatar






