Updated sample code that can detect the .NET Framework 3.5

Now that the .NET Framework 3.5 has been released, I have posted an updated version of the .NET Framework detection sample code that I previously published.  The updated version includes logic to detect the presence of the .NET Framework 3.5 and also .NET Framework 3.0 service packs, which was missing from previous versions of this sample code.

You can download updated versions of the sample code at the following locations:

For reference, the registry locations used in this sample code to detect the .NET Framework 3.0 service pack level and the .NET Framework 3.5 are listed below.

To detect the .NET Framework 3.0 service pack level:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0]
SP = <value>

Note - this SP value will not exist at all if you only have the original release of the .NET Framework 3.0.  This value was added starting in the .NET Framework 3.0 SP1 and will be updated for future service packs.

To detect the .NET Framework 3.5 final release:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5]
Install = 1
Version = 3.5.21022.08

To detect the .NET Framework 3.5 service pack level:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5]
SP = <value>

Note - this SP value does exist in the final release of the .NET Framework 3.5, and will be set to 0.  Future service packs will increment this value as appropriate.

<update date="4/8/2009"> Fixed broken links to the sample code. </update>