RegisterAutoLoadAttribute Class

Definition

Caution

RegisterAutoLoadAttribute has been deprecated. Please use ProvideAutoLoadAttribute instead.

This attribute registers the package as an extender. The GUID passed in determines what is being extended. The attributes on a package do not control the behavior of the package, but they can be used by registration tools to register the proper information with Visual Studio.

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
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
[<System.Obsolete("RegisterAutoLoadAttribute has been deprecated. Please use ProvideAutoLoadAttribute instead.")>]
type RegisterAutoLoadAttribute = class
    inherit RegistrationAttribute
Public NotInheritable Class RegisterAutoLoadAttribute
Inherits RegistrationAttribute
Inheritance
RegisterAutoLoadAttribute
Attributes

Remarks

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.

Note

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

Samples

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.

Constructors

RegisterAutoLoadAttribute(String)

Specify that the package should get loaded when this context is active.

Properties

LoadGuid

Context Guid which triggers the loading of the package.

TypeId

Gets the current instance of this attribute.

(Inherited from RegistrationAttribute)

Methods

GetPackageRegKeyPath(Guid)

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

(Inherited from RegistrationAttribute)
Register(RegistrationAttribute+RegistrationContext)

Called to register this attribute with the given context. The context contains the location where the registration information should be placed. it also contains such as the type being registered, and path information.

Unregister(RegistrationAttribute+RegistrationContext)

Unregister this AutoLoad specification.

Applies to