Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual Studio SDK
Package Class
 ApplicationRegistryRoot Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio SDK
Package..::.ApplicationRegistryRoot Property

Updated: November 2007

Gets the root registry key of the current Visual Studio registry hive.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)

Visual Basic (Declaration)
Public ReadOnly Property ApplicationRegistryRoot As RegistryKey
Visual Basic (Usage)
Dim instance As Package
Dim value As RegistryKey

value = instance.ApplicationRegistryRoot
C#
public RegistryKey ApplicationRegistryRoot { get; }
Visual C++
public:
property RegistryKey^ ApplicationRegistryRoot {
    RegistryKey^ get ();
}
JScript
public function get ApplicationRegistryRoot () : RegistryKey

Property Value

Type: Microsoft.Win32..::.RegistryKey

The root RegistryKey of the Visual Studio registry hive.

This property returns the registry root for the application. Typically this is HKLM\Software\Microsoft\VisualStudio\<version> but this can change based on any alternate root that the shell was initialized with.

The key that is returned is a read-only key and cannot be modified. Changes to this key should only be made by the VSPackage installer.

You should close and dispose this key when you are finished using it. You can reliably accomplish this by using this key with the “using” syntax in C#:

using(RegistryKey k = p.ApplicationRegistryRoot) {
  // define k
}

Here, k is disposed when the using clause terminates.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker