How to: Create VSPackages (C# and Visual Basic)
The Visual Studio Integration Package Wizard creates a basic implementation of a simple VSPackage given the company name, the VSPackage name, and the VSPackage version number. The wizard can add code to create a simple menu command, a tool window, or a custom editor.
To create a VSPackage by using the Visual Studio Integration Package Wizard
On the File menu, point to New, and then click Project.
In the New Project dialog box, expand Other Project Types, and then click Extensibility.
In the Templates pane click Visual Studio Integration Package.
In the Location box, type the file path for your VSPackage.
In the Name box, type the name for the solution and then click OK to start the wizard.
On the Select a Programming Language page, select either Visual C# or Visual Basic. Have the wizard generate a key.snk file to sign the assembly. Alternatively, Browse to your own key file. The wizard makes a copy of your key file and names it key.snk.
Specify details about your VSPackage in the Basic VSPackage Information page. This information is written into the system registry. It can also appear in the Help About dialog box and on the Visual Studio splash screen. For more information, see VSPackage Branding.
Click Next to specify options for your VSPackage, or click Finish to create a basic VSPackage.
Select the Menu Command option to create a new command for your VSPackage. The new command is put at the top of the Tools menu. When the Menu Command option is selected, the Command Options page is displayed after you click Next.
Type the name for the new menu command in the Command Name box.
If you later want to host the command as a button on the toolbar, the name is also the button's tooltip.
Type the command ID for your menu command in the Command ID text box.
The command ID is the name of a constant that represents this menu command in the generated code.
Click Next to select test project options for your VSPackage, or click Finish to create a basic VSPackage.
Check the Integration Test Project (C#) check box to create a test project for your solution.
Click Finish to create your VSPackage in the folder that you specified.
To test your menu command
Build the solution, and then start the experimental build of Visual Studio by pressing F5.
On the Tools menu, click your command. A message appears with the following text:
Inside vsip.<Project name>.<VSPackage name>.Exec().
Compiling the Code
Projects generated with the wizard have embedded paths that refer to utilities like Regpkg.exe. To use them on another computer, you must make sure that the paths are valid.