This post is part of a larger tutorial on DSL Tools and Visual Studio 2008 Isolated Shell, in this post I will go through creating a Visual Studio 2008 shell application that we later can add the DSL and a custom project type to.
Previous step: Creating a sample DSL
Creating a new Isolated Shell application
In this section we will create a new Isolated Shell application in a new solution.
1. New project
Choose Visual Studio Shell Isolated and name the project “MyDslShell”, in the location select “D:\project\DslToolsAndVsShell\Code\MyDSLApplication” and uncheck Create directory for solution.

2. Created solution
Now you should have a new Shell solutions as shown below.

The folder structure should look as show below.

3. Set debugger
You should set debugger type on the “MyDslShell” project to Managed Only, otherwise you can encounter problems when trying to debug managed packages.

4. Testing the solution
Build the solution and press F5 to start, you should get an empty shell as shown below.

Adding a Shell Load Key (SLK)
1. Gathering necessary information for obtaining a SLK
To obtain a SLK you will need the following information:
- Company name
- Shell name
- Shell Guid
- Shell version
The information can be found in “MyDslShell” project in the file “MyDslShell.pkgdef”, please not that you will have to add some yourself.
The Shell Guid and Shell Name can be found in the beginning the file, as shown below.

Further down in the file you find Company Name and Product version, these are commented out, so you will have to uncomment them. The Company Name is NOT filled out by default, so you will have to fill that in yourself.

2. Obtaining a Shell Load Key (SLK)
You can obtain a Shell Load Key (PLK) from MSDN: Generate Load Keys
Enter the information from the Constants.cs, choose “Standard” as Min. Product Edition and “Visual Studio 2008” as min. VS Version. Finally press “Generate SLK”.

3. Adding the Shell Load Key (SLK) to Shell
We have to add the SLK to the “MyDslShell” projects resource file “MyDslShell.rc”. Open “MyDslShell.rc” and navigate to the String Table and find the entry “IDS_SLKSTRING” and fill in the SLK without any newlines.

Next we will have to add a value to the “MyDslShell.pkgdef” file. Find the line
"ID"=dword:00000069
and uncomment it. Make sure that you get the right line; it should be below the common explaining SLK’s. Note the number 69, this is in hexadecimal, in decimal it will be 105 and must match the number on the above screen dump.

Adding a Package Load Key (PLK)
The “MyDslShellUI” project is a Visual Studio integration package, so we need to add a Package Load Key (PLK) to this project.
1. Gathering necessary information for obtaining a PLK
To obtain a PLK you will need the following information:
- Company name
- Package name
- Package Guid
- Package version
The information can be found in “MyDslShell” project (note, it’s not in the “MyDslShellUI” ) in the bottom of file “MyDslShell.pkgdef”, also not that you will have to add the company name yourself.

2. Obtaining a Package Load Key (PLK)
You can obtain a Package Load Key (PLK) from MSDN: Generate Load Keys
Enter the information from above, choose “Standard” as Min. Product Edition and “Visual Studio 2008” as min. VS Version. Finally press “Generate PLK”.

3. Adding the Package Load Key (PLK) to the Shell UI package
The Shell UI package has it’s Package Load Key (PLK) in the “MyDslShellUI.rc” file.

4. Running and validating the Shell
To test the SLK and PLK you have to add the /NoVSIP option to the debugging startup parameter. This will make Visual Studio perform the SLK and PLK validation even when you have you have Visual Studio SDK installed.

Now rebuild the solution and try to run the Shell using F5

Summary
This end the third post about creating a Shell application, next step is about adding the DSL to the Shell application.
Next step: Adding the DSL to the Shell
Download: DslToolsAndVsShell-03.zip (5 MB)