Partager via


PackageRegistrationAttribute Class

Modify your class that implements IVsPackage with this attribute so that the registration tool regpkg.exe will look for additional attributes. For more information, see How to: Register Managed VSPackages.

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

Syntax

<AttributeUsageAttribute(AttributeTargets.Class, Inherited := True, AllowMultiple := False)> _
Public NotInheritable Class PackageRegistrationAttribute _
    Inherits RegistrationAttribute

Dim instance As PackageRegistrationAttribute
[AttributeUsageAttribute(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
public sealed class PackageRegistrationAttribute : RegistrationAttribute
[AttributeUsageAttribute(AttributeTargets::Class, Inherited = true, AllowMultiple = false)]
public ref class PackageRegistrationAttribute sealed : public RegistrationAttribute
public final class PackageRegistrationAttribute extends RegistrationAttribute

Remarks

The tool regpkg.exe uses C# reflection to determine the attributes that modify your assembly-implemented package. The regpkg.exe tool then evaluates each attribute with information specific to the current installation and creates registry entries that describe the package to Visual Studio. If your class inherits from the Managed Package Framework class Package this attribute is already included. If you create your own class that implements IVsPackage, be sure to manually modify your class with one PackageRegistrationAttribute or the package will not load.

Inheritance Hierarchy

System.Object
  System.Attribute
    Microsoft.VisualStudio.Shell.RegistrationAttribute
      Microsoft.VisualStudio.Shell.PackageRegistrationAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Concepts

How to: Register Managed VSPackages

Reference

PackageRegistrationAttribute Members

Microsoft.VisualStudio.Shell Namespace