RegisterAutoLoadAttribute Class



This API is now obsolete.

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
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.



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



Context Guid which triggers the loading of the package.


Override the TypeID property in order to let the RegistrationAttribute derived classes to work with System.ComponentModel.TypeDescriptor.GetAttributes(...). An attribute derived from this one will have to override this property only if it needs a better control on the instances that can be applied to a class.

(Inherited from RegistrationAttribute)



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

(Inherited from RegistrationAttribute)

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 this AutoLoad specification.

Applies to