Condividi tramite


ProvideLoadKeyAttribute Constructor

Creates a new ProvideLoadKeyAttribute.

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

Syntax

'Declaration
Public Sub New ( _
    minimumEdition As String, _
    productVersion As String, _
    productName As String, _
    companyName As String, _
    resourceId As Short _
)
public ProvideLoadKeyAttribute(
    string minimumEdition,
    string productVersion,
    string productName,
    string companyName,
    short resourceId
)
public:
ProvideLoadKeyAttribute(
    String^ minimumEdition, 
    String^ productVersion, 
    String^ productName, 
    String^ companyName, 
    short resourceId
)
new : 
        minimumEdition:string * 
        productVersion:string * 
        productName:string * 
        companyName:string * 
        resourceId:int16 -> ProvideLoadKeyAttribute
public function ProvideLoadKeyAttribute(
    minimumEdition : String, 
    productVersion : String, 
    productName : String, 
    companyName : String, 
    resourceId : short
)

Parameters

  • minimumEdition
    Type: String

    The minimum edition of Visual Studio on which the VSPackage is loaded. This must be the literal edition value provided by Microsoft when obtaining your Package Load Key (PLK).

  • productVersion
    Type: String

    The version of the product that this VSPackage implements.

  • productName
    Type: String

    Name of the product that this VSPackage delivers. Products comprised of multiple VSPackages each need their own PLK.

  • companyName
    Type: String

    VSIP Partner/creator of the VSPackage. Must exactly match the name you provided to Microsoft when you registered for a PLK. companyName is case-sensitive.

  • resourceId
    Type: Int16

    Resource ID for VSPackage load key.

Exceptions

Exception Condition
ArgumentNullException

minimumEdition, productVersion, productName or companyName are nulla null reference (Nothing in Visual Basic).

Remarks

Important

Packages that target Visual Studio 2010 only do not need a package load key.

Packages that target Visual Studio 2008 and earlier must have a package load key in order to validate and load VSPackages. This includes VSPackages provided by third parties, regardless of whether the hosting version of Visual Studio has a VSIP license.

Note

Visual C# automatically appends the word Attribute to the name of any attribute class. In Visual C# code, refer to this attribute as ProvideLoadKey.

Examples

The following Visual C# code applies the ProvideLoadKey attribute to a VSPackage named MyVSPackage.

using Microsoft.VisualStudio.Shell;
using MSVSIP = Microsoft.VisualStudio.Shell;
[MSVSIP.ProvideLoadKey(typeof(MyObject))]
public class MyVSPackage : MSVSIP.Package {}

.NET Framework Security

See Also

Reference

ProvideLoadKeyAttribute Class

Microsoft.VisualStudio.Shell Namespace