How to detect the installed version of the .NET Framework in a Visual Studio Setup and Deployment package
This article was previously published under Q315291 On This PageINTRODUCTIONThis step-by-step article describes how to use the Microsoft Visual Studio .NET IDE to verify the version of the .NET Framework that is installed on a client computer for software installation purposes.
Note This article does not show you how to programmatically detect the .NET Framework in a managed application. The scenario that is covered in this article is a deployment scenario where a developer is not sure of the version of the .NET Framework that is installed on the client computer. This article also does not show you how to detect if a service pack is installed in the .NET Framework. MORE INFORMATIONRequired knowledgeThis article assumes that you are familiar with the following topic:Visual Studio .NET deployment and setup projects Detect the current installed versionTo add a launch condition in the deployment project against the .NET Framework version registry key, follow these steps:
Locate the following key for the .NET Framework 1.0: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0
Rename the previous key to the following:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\XXXv1.0
Locate the following key for the .NET Framework 1.1:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.1
Rename the previous key to the following:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\XXXv1.1 Locate the following key for the .NET Framework 2.0:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v2.0
Rename the previous key to the following: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\XXXv2.0 Do not forget to rename the key after you complete your test. REFERENCES
For additional information, visit the following Microsoft Developer Network (MSDN) Web sites: Creating or adding deployment projects http://msdn.microsoft.com/library/en-us/vsintro7/html/vbconCreatingOrAddingDeploymentProjects.asp (http://msdn.microsoft.com/library/en-us/vsintro7/html/vbconCreatingOrAddingDeploymentProjects.asp) Adding items to a deployment project http://msdn.microsoft.com/library/en-us/vsintro7/html/vbconaddingitemstodeploymentproject.asp (http://msdn.microsoft.com/library/en-us/vsintro7/html/vbconaddingitemstodeploymentproject.asp) Properties for the Launch Conditions Editor http://msdn.microsoft.com/library/en-us/vsintro7/html/vxconlaunchconditionproperties.asp (http://msdn.microsoft.com/library/en-us/vsintro7/html/vxconlaunchconditionproperties.asp) Adding a launch condition in the Launch Conditions Editor http://msdn.microsoft.com/library/en-us/vsintro7/html/vxtskaddinglaunchcondition.asp (http://msdn.microsoft.com/library/en-us/vsintro7/html/vxtskaddinglaunchcondition.asp) APPLIES TO
| Article Translations
|

Back to the top
