[.net-3.5] How do I tell if .NET 3.5 SP1 is installed?

How can I find out if SP1 has been installed on a server which has .NET 3.5?

This question is related to .net-3.5 installation

The answer is


You could go to SmallestDotNet using IE from the server. That will tell you the version and also provide a download link if you're out of date.


Assuming that the name is everywhere "Microsoft .NET Framework 3.5 SP1", you can use this:

string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
    return rk.GetSubKeyNames().Contains("Microsoft .NET Framework 3.5 SP1");
}

Take a look at this article which shows the registry keys you need to look for and provides a .NET library that will do this for you.

First, you should to determine if .NET 3.5 is installed by looking at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\Install, which is a DWORD value. If that value is present and set to 1, then that version of the Framework is installed.

Look at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\SP, which is a DWORD value which indicates the Service Pack level (where 0 is no service pack).

To be correct about things, you really need to ensure that .NET Fx 2.0 and .NET Fx 3.0 are installed first and then check to see if .NET 3.5 is installed. If all three are true, then you can check for the service pack level.


Look at HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\. One of these must be true:

  • The Version value in that key should be 3.5.30729.01
  • Or the SP value in the same key should be 1

In C# (taken from the first comment), you could do something along these lines:

const string name = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5";
RegistryKey subKey = Registry.LocalMachine.OpenSubKey(name);
var version = subKey.GetValue("Version").ToString();
var servicePack = subKey.GetValue("SP").ToString();

You could go to SmallestDotNet using IE from the server. That will tell you the version and also provide a download link if you're out of date.


Look at HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\. One of these must be true:

  • The Version value in that key should be 3.5.30729.01
  • Or the SP value in the same key should be 1

In C# (taken from the first comment), you could do something along these lines:

const string name = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5";
RegistryKey subKey = Registry.LocalMachine.OpenSubKey(name);
var version = subKey.GetValue("Version").ToString();
var servicePack = subKey.GetValue("SP").ToString();

Assuming that the name is everywhere "Microsoft .NET Framework 3.5 SP1", you can use this:

string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
    return rk.GetSubKeyNames().Contains("Microsoft .NET Framework 3.5 SP1");
}

Take a look at this article which shows the registry keys you need to look for and provides a .NET library that will do this for you.

First, you should to determine if .NET 3.5 is installed by looking at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\Install, which is a DWORD value. If that value is present and set to 1, then that version of the Framework is installed.

Look at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\SP, which is a DWORD value which indicates the Service Pack level (where 0 is no service pack).

To be correct about things, you really need to ensure that .NET Fx 2.0 and .NET Fx 3.0 are installed first and then check to see if .NET 3.5 is installed. If all three are true, then you can check for the service pack level.


Look at HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\. One of these must be true:

  • The Version value in that key should be 3.5.30729.01
  • Or the SP value in the same key should be 1

In C# (taken from the first comment), you could do something along these lines:

const string name = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5";
RegistryKey subKey = Registry.LocalMachine.OpenSubKey(name);
var version = subKey.GetValue("Version").ToString();
var servicePack = subKey.GetValue("SP").ToString();

Take a look at this article which shows the registry keys you need to look for and provides a .NET library that will do this for you.

First, you should to determine if .NET 3.5 is installed by looking at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\Install, which is a DWORD value. If that value is present and set to 1, then that version of the Framework is installed.

Look at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\SP, which is a DWORD value which indicates the Service Pack level (where 0 is no service pack).

To be correct about things, you really need to ensure that .NET Fx 2.0 and .NET Fx 3.0 are installed first and then check to see if .NET 3.5 is installed. If all three are true, then you can check for the service pack level.


You could go to SmallestDotNet using IE from the server. That will tell you the version and also provide a download link if you're out of date.


I came to this page while trying to figure out how to detect the framework versions installed on a server without access to remote desktop or registry, so Danny V's answer worked for me.

string path = System.Environment.SystemDirectory;
path = path.Substring( 0, path.LastIndexOf('\\') );
path = Path.Combine( path, "Microsoft.NET" );
// C:\WINDOWS\Microsoft.NET\

string[] versions = new string[]{
    "Framework\\v1.0.3705",
    "Framework64\\v1.0.3705",
    "Framework\\v1.1.4322",
    "Framework64\\v1.1.4322",
    "Framework\\v2.0.50727",
    "Framework64\\v2.0.50727",
    "Framework\\v3.0",
    "Framework64\\v3.0",
    "Framework\\v3.5",
    "Framework64\\v3.5",
    "Framework\\v3.5\\Microsoft .NET Framework 3.5 SP1",
    "Framework64\\v3.5\\Microsoft .NET Framework 3.5 SP1",
    "Framework\\v4.0",
    "Framework64\\v4.0"
};

foreach( string version in versions )
{
    string versionPath = Path.Combine( path, version );

    DirectoryInfo dir = new DirectoryInfo( versionPath );
    if( dir.Exists )
    {
        Response.Output.Write( "{0}<br/>", version );
    }
}

Assuming that the name is everywhere "Microsoft .NET Framework 3.5 SP1", you can use this:

string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
    return rk.GetSubKeyNames().Contains("Microsoft .NET Framework 3.5 SP1");
}

Check is the following directory exists:

In 64bit machines: %SYSTEMROOT%\Microsoft.NET\Framework64\v3.5\Microsoft .NET Framework 3.5 SP1\

In 32bit machines: %SYSTEMROOT%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5 SP1\

Where %SYSTEMROOT% is the SYSTEMROOT enviromental variable (e.g. C:\Windows).


Assuming that the name is everywhere "Microsoft .NET Framework 3.5 SP1", you can use this:

string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
    return rk.GetSubKeyNames().Contains("Microsoft .NET Framework 3.5 SP1");
}

Take a look at this article which shows the registry keys you need to look for and provides a .NET library that will do this for you.

First, you should to determine if .NET 3.5 is installed by looking at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\Install, which is a DWORD value. If that value is present and set to 1, then that version of the Framework is installed.

Look at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\SP, which is a DWORD value which indicates the Service Pack level (where 0 is no service pack).

To be correct about things, you really need to ensure that .NET Fx 2.0 and .NET Fx 3.0 are installed first and then check to see if .NET 3.5 is installed. If all three are true, then you can check for the service pack level.


You could go to SmallestDotNet using IE from the server. That will tell you the version and also provide a download link if you're out of date.


Check is the following directory exists:

In 64bit machines: %SYSTEMROOT%\Microsoft.NET\Framework64\v3.5\Microsoft .NET Framework 3.5 SP1\

In 32bit machines: %SYSTEMROOT%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5 SP1\

Where %SYSTEMROOT% is the SYSTEMROOT enviromental variable (e.g. C:\Windows).


I came to this page while trying to figure out how to detect the framework versions installed on a server without access to remote desktop or registry, so Danny V's answer worked for me.

string path = System.Environment.SystemDirectory;
path = path.Substring( 0, path.LastIndexOf('\\') );
path = Path.Combine( path, "Microsoft.NET" );
// C:\WINDOWS\Microsoft.NET\

string[] versions = new string[]{
    "Framework\\v1.0.3705",
    "Framework64\\v1.0.3705",
    "Framework\\v1.1.4322",
    "Framework64\\v1.1.4322",
    "Framework\\v2.0.50727",
    "Framework64\\v2.0.50727",
    "Framework\\v3.0",
    "Framework64\\v3.0",
    "Framework\\v3.5",
    "Framework64\\v3.5",
    "Framework\\v3.5\\Microsoft .NET Framework 3.5 SP1",
    "Framework64\\v3.5\\Microsoft .NET Framework 3.5 SP1",
    "Framework\\v4.0",
    "Framework64\\v4.0"
};

foreach( string version in versions )
{
    string versionPath = Path.Combine( path, version );

    DirectoryInfo dir = new DirectoryInfo( versionPath );
    if( dir.Exists )
    {
        Response.Output.Write( "{0}<br/>", version );
    }
}

Look at HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\. One of these must be true:

  • The Version value in that key should be 3.5.30729.01
  • Or the SP value in the same key should be 1

In C# (taken from the first comment), you could do something along these lines:

const string name = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5";
RegistryKey subKey = Registry.LocalMachine.OpenSubKey(name);
var version = subKey.GetValue("Version").ToString();
var servicePack = subKey.GetValue("SP").ToString();