How to: Install a PLK (C#)
After you obtain a package load key (PLK), you must install it in your VSPackage. For more information, see.
To install and test a PLK in a VSPackage
Open the project to which you want to add the PLK.
In Solution Explorer find the resource file that is associated with your VSPackage, for example, VSPackage.resx, and open it.
Add a numbered resource, for example, 104. Give it the value of the PLK that you obtained for your VSPackage, for example:
Update or add theattribute to the class that implements your VSPackage, for example:
[ProvideLoadKey("Standard", "1.0", "My Package Name", "My Company", 104)] [Guid("5b28f8b4-3812-4b3c-b584-437433a45897")] public sealed class MyPackage : Package
where "Standard" is the minimum Visual Studio edition, "1.0" is the product version, "My Package Name" is the VSPackage name, "My Company" is your company name, and 104 is the resource ID of the PLK. All arguments should exactly match the information that was used to obtain the PLK, except that all arguments are case-insensitive.
Rebuild the solution and verify that it compiles without errors.
The PLK is compiled into the VSPackage and registered accordingly.
In Solution Explorer, right-click the MP project node and then click Properties. Add the /noVSIP switch to the Debug/Command line arguments entry:
/rootsuffix Exp /noVSIP
This makes sure that Visual Studio examines the PLK instead of the DLK.
Press F5 to start the program under the debugger.
Visual Studio Exp opens.
On the Tools menu, click MP.
A Visual Studio message box appears and you see a message such as this in the Output window of the experimental build:
VSIP: Third party package 'Vsip.MP.MP' ... approved to load ...
This message shows that you have successfully loaded your VSPackage with the PLK.
If your package does not load, see.