How to: Add an SLK to an Isolated Shell Project
Updated: July 2008
After you obtain a shell load key (SLK), you must add it to your Shell project. Follow this procedure to add an SLK to a project that was created by using the Visual Studio Shell Isolated template.
The Visual Studio Shell Isolated template creates a user interface (UI) project. A UI project requires a package load key (PLK), as do any other VSPackages that you add to your application.
To add an SLK to an isolated Shell project
Open the project to which you want to add the SLK.
In Solution Explorer, find the resource file that is associated with your application, for example, MyShellStub1.rc, and open it.
Open the string table. The Visual Studio Shell Isolated template creates an entry for the SLK. The default entry has an ID of IDS_SLKSTRING, a value of 105, and a caption of "TODO: Enter SLK here". Replace the caption with the value of the SLK that you obtained for your Shell application, for example, as follows:
Save and close the string table and the resource file.
In Solution Explorer, find the .pkgdef file that is associated with your isolated Shell-based application, for example, MyShellStub1.pkgdef, and open it.
In the .pkgdef file, verify that the correct values are defined under the [$RootKey$] key, as follows:
The GUID of your application. This must match the Shell GUID value that you used to generate the SLK.
The name of your application. This must match the Shell Name value that you used to generate the SLK.
The name of your company. This must match the company name that you used to generate the SLK.
The version string for your application. This must match the Shell Version value that you used to generate the SLK.
The resource identifier for the SLK in the string table of the application, for example, as follows:
The identifier value in the .pkgdef file is represented in hexidecimal, but the corresponding value in the string table is represented in decimal.
Rebuild the solution and verify that it compiles without errors. Visual Studio compiles the SLK into the application and registers it accordingly.
To test an SLK in an isolated Shell project
In Solution Explorer, right-click the Shell project node and then click Properties. Under Configuration Properties, Debugging, add the /noVSIP switch to the Command Arguments field.
This guarantees that Visual Studio examines the SLK instead of the DLK.
Press F5 to start the program under the debugger.
If Visual Studio validates the SLK, your application opens.
If Visual Studio does not validate the SLK, a dialog box, which explains that a valid SLK is required for the application to run, is displayed. When you click OK, the application closes.