RegisterAutoLoadAttribute RegisterAutoLoadAttribute RegisterAutoLoadAttribute RegisterAutoLoadAttribute RegisterAutoLoadAttribute Class



This API is now obsolete.

Registers the VSPackage as an extender that is automatically loaded in response to a particular context GUID. This class cannot be inherited.

public ref class RegisterAutoLoadAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
public ref class RegisterAutoLoadAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
[System.Obsolete("RegisterAutoLoadAttribute has been deprecated. Please use ProvideAutoLoadAttribute instead.")]
public sealed class RegisterAutoLoadAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
type RegisterAutoLoadAttribute = class
    inherit RegistrationAttribute
Public NotInheritable Class RegisterAutoLoadAttribute
Inherits RegistrationAttribute


Basic Usage

RegisterAutoLoadAttribute registers the VSPackage as an extender (an object which implements IExtenderProvider. The GUID passed to the constructor determines the context in which the package loads. To use RegisterAutoLoadAttribute, place it on a package class, such as Package or a class that implements IVsPackage.

This attribute class is only used to provide data for external registration tools. It does not have any effect on the runtime behavior of the VSPackage.


Visual C# automatically appends the word "Attribute" to the name of any attribute class. In Visual C# code, this attribute is RegisterAutoLoad.

Registry Entries

The following registry entries are created by RegisterAutoLoadAttribute:

  • <VSROOT>\AutoLoadPackages\{ContextGuid}

  • <VSROOT>\AutoLoadPackages\{ContextGuid}\{PackageGuid}=0


You can find implementations of the RegisterAutoLoadAttribute class in the managed samples. The standard location for this and all other attributes used for automatic registration is adjacent to the implementation of the Package class in VsPkg.cs, VsPkg.vb, or VsPkg.cpp, depending on the language used in the sample.


RegisterAutoLoadAttribute(String) RegisterAutoLoadAttribute(String) RegisterAutoLoadAttribute(String) RegisterAutoLoadAttribute(String) RegisterAutoLoadAttribute(String)

Creates a new RegisterAutoLoadAttribute object and saves the GUID of the package that initiated package loading.


LoadGuid LoadGuid LoadGuid LoadGuid LoadGuid

Returns the context GUID that triggers package load.

TypeId TypeId TypeId TypeId TypeId

Gets the current instance of this attribute.

(Inherited from RegistrationAttribute)


GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid)

Gets the registry path (relative to the registry root of the application) of the VSPackage.

(Inherited from RegistrationAttribute)
Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext)

Provides registration information about a VSPackage when called by an external registration tool such as RegPkg.exe.

Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext)

Removes registration information about a VSPackage when called by an external registration tool such as RegPkg.exe.

Applies to