Walkthrough: Creating a Basic Isolated Shell Application
This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here
This walkthrough shows how to create an isolated shell solution, customize the Help About tool window, and create a setup program that installs the isolated shell.
To follow this walkthrough, you must install the Visual Studio SDK. For more information, see Visual Studio SDK. To deploy the isolated shell, you must also use the Visual Studio Shell (Isolated) Redistributable Package.
Creating an Isolated Shell Solution
This section shows how to use the Visual Studio Shell Isolated project template to create an isolated shell solution. The solution contains the following projects:
The SolutionName.AboutBoxPackage project, which allows you to customize the appearance of the Help/About box.
The ShellExtensionsVSIX project, which contains the source.extension.vsixmanifest file that defines the different components of the isolated shell application.
The SolutionName project, which produces the executable file that invokes the isolated shell application. This project contains the Shell Customization folder, which allows you to customiz the appearance and behavior of the isolated shell application.
The SolutionName UI project, which produces a satellite assembly that defines active menu commands and localizable strings.
To create a basic isolated shell solution
Open Visual Studio and create a new project.
In the New Project window, expand Other Project Types and then Extensibility. Select the Visual Studio Shell Isolated project template.
Name the project
MyVSShellStuband specify a location. Make sure that Create directory for solution is checked, and then click OK.
The new solution appears in Solution Explorer.
Build the solution and start debugging the isolated shell application.
The Visual Studio isolated shell appears. The title bar reads MyVSShellStub. The title bar icon is generated from \MyVSShellStub\Resource Files\ApplicationIcon.ico.
Customizing the Application Name and Icon
You may want to brand your application by using the name of your company and its logo in the title bar. The following steps show how to change the name and icon that are displayed in the custom application title bar by changing the package definition file, MyVSShellStub.Application.pkgdef.
To customize the application name and icon
In the MyVSShellStub project, open \Shell Customization\MyVSShellStub.Application.pkgdef.
AppNameelement value to "AppName"="Fabrikam Music Editor"
To change the application icon, copy a different icon to the \MyVSShellStub\MyVSShellStub\MyVSShellStub\ directory. Rename the existing ApplicationIcon.ico file to ApplicationIcon1.ico. Rename the new file to ApplicationIcon.ico.
Build the solution and start debugging. The isolated shell IDE appears. The title bar has your new icon next to the words Fabrikam Music Editor.
Customizing the Default Web Browser Home Page
This section shows how to change the default home page of the Web Browser window by changing the package definition file.
To customize the default Web Browser home page
In the MyVSShellStub.Application.pkgdef file, change the
DefaultHomePageelement value to "http://www.microsoft.com".
Rebuild the MyVSShellStub project.
Build the solution and start debugging.
In View / Other Windows, click Web Browser. The Web Browser window displays the Microsoft Corporation home page.
Removing the Print Command
The .vsct file in an isolated shell UI project consists of a set of declarations of the form
>, where Element is one of the standard Visual Studio menus and commands.
If a declaration is uncommented, that menu or command is excluded from the isolated shell. Conversely, if a declaration is commented, the menu or command is included in the isolated shell.
In the following steps, you uncomment print command in your .vsct file.
To remove the print command
Verify that the Print command appears on the File menu in the isolated shell application.
In the MyVSShellStubUI project, open \Resource Files\MyVSShellStubUI.vsct for editing.
Uncomment this line:
<!-- <Define name="No_PrintChildrenCommand"/> -->
This removes the print command.
Start debugging the isolated shell application. Verify that the File / Print command is gone.
Removing Features from the Isolated Shell
You can remove some of the packages that are loaded with Visual Studio by editing the .pkgundef file if you do not want those features in your custom isolated shell application. You specify the package in one of the subkeys of the $RootKey$\Packages registry key.
To find the GUIDs of Visual Studio features, see Package GUIDs of Visual Studio Features.
The following procedure shows how to remove the XML editor from the isolated shell.
To remove the XML editor
Open the MyVSShellStub.pkgundef file in the Shell Customization folder of the MyVSShellStub project.
Uncomment the following line:
Rebuild the solution and start debugging the isolated shell. Open an XML file,for example, \MyVSShellStub\MyVSShellStub\MyVSShellStubUI\MyVSShellStubUI.vsct. Verify that the XML keywords in the file are not colorized and that typing "<" on a line does not bring up XML tooltips.
Customizing the Help/About box
You can customize the Help/About box, which is created as part of the isolated shell project template.
To customize the company name
The company name, copyright information, product version, and product description are found in the MyVSShellStub.AboutBoxPackage project, in the \Properties\AssemblyInfo.cs file. Open this file.
AssemblyCompanyvalue to Fabrikam, the
AssemblyTitlevalues to Fabrikam Music Editor, and the
AssemblyCopyrightvalue to Copyright © Fabrikam 2015:
[assembly: AssemblyTitle("Fabrikam Music Editor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Fabrikam")] [assembly: AssemblyProduct("Fabrikam Music Editor")] [assembly: AssemblyCopyright("Copyright © Fabrikam 2015")] [assembly: AssemblyCompany("Fabrikam")] [assembly: AssemblyProduct("Fabrikam Music Editor ")] [assembly: AssemblyCopyright("Copyright © Fabrikam 2015”)]
To add a description of the product, change the
AssemblyDescriptionvalue to The description of Fabrikam Music editor.:
[assembly: AssemblyDescription("The description of Fabrikam Music editor.”)]
Start debugging and in the isolated shell application, open the Help / About box. You should see the changed strings. The title of the Help/About box is the same as the
AssemblyTitlevalue in AssemblyInfo.cs.
The properties of the Help/About box itself are found in the MyVSShellStub.AboutBoxPackage\AboutBox.xaml file. To change the width of the Help/About box, go to the
AboutDialogStyleblock and set the
Widthproperty to 200:
<Style x:Key="AboutDialogStyle" TargetType="Window"> <Setter Property="Height" Value="Auto" /> <Setter Property="Width" Value="200" /> <Setter Property="ShowInTaskbar" Value="False" /> <Setter Property="ResizeMode" Value="NoResize" /> <Setter Property="WindowStyle" Value="SingleBorderWindow" /> <Setter Property="SizeToContent" Value="Height" /> </Style>
Rebuild the solution and start debugging the isolated shell. The Help/About box should be approximately square.
Before You Deploy the Isolated Shell Application
Your isolated shell application can be installed on any computer that has the Visual Studio Shell (Isolated) Redistributable Package. For more information about the redistributable package, see the Visual Studio Extensibility Downloads website.
Deploying the Isolated Shell Application
You deploy your isolated shell application to a target computer by creating a setup project. You must specify these things:
The layout of the folders and files on the target computer.
The launch conditions that guarantee that the .NET Framework and the Visual Studio shell runtime are installed on the target computer.
In the following procedure you will need to install InstallShield Limited Edition on your computer.
To create the setup project
In Solution Explorer, right-click the solution node and then click Add New Project.
In the New Project dialog box, expand Other Project Types and then select Setup and Deployment. Select the InstallShield template. Name the new project
MySetupand then click OK.
If InstallShield Limited Edition is already installed, continue to the next step.
If InstallShield Limited Edition is not already installed, the InstallShield download page appears. Follow the instructions to download and install the product, choosing the version of InstallShield that is compatible with your version of Visual Studio. You must decide whether to register your installation of InstallShield or use it as an evaluation. You must restart Visual Studio after you complete the installation.
You must start Visual Studio as an administrator before you create an InstallShield project. If you do not do so, you will get an error when you build the project.
The next steps show how to configure the setup project.
Make sure that you have built the release configuration of your isolated shell project at least once before you configure the setup project.
To configure the setup project
In the Solution Explorer, under the MySetup project, choose Project Assistant. On the bottom row of the Project Assistant window, choose Application Information. Enter Fabrikam as your company name and Fabrikam Music Editor as your application name. Choose the forward arrow at the bottom right of the Project Assistant.
Select Yes under Does your application require any software to be installed on the machine? and then select Microsoft .NET Framework 4.5 Full Package.
Choose the Application Files button at the bottom of the window, and make sure that the Fabrikam Music Editor folder is selected.
Choose the Add Files button. In the Add Files dialog box, add the following files from the MyVSShellStub\Release folder:
Click the Add Project Outputs button and add MyVSShellStub/Primary Output. Click OK.
In the left pane, under Destination Computer, right-click the Fabrikam Music Editor [INSTALLDIR] node and add a New Folder named Extensions.
Right-click the Extensions node in the left pane and add a new folder named Application.
Select the Application folder and click the Add Project Outputs button, then select the primary output from the MyVSShellStub.AboutBoxPackage project.
Click the Add Files button and from the \MyVSShellStub\Release\Extensions\Application\ folder add the following files:
Right-click the Fabrikam Music Editor [INSTALLDIR] node in the left pane and add a new folder named 1033.
Select the 1033 folder and then click the Add Project Outputs button, and select the primary output from the MyVSShellStubUI project.
Move to the Application Shortcuts window.
Click New to create a shortcut and select [ProgramFilesFolder]\Fabrikam\Fabrikam Music Editor\MyVSShellStub.Primary Output.
Move to the Installation Interview pane.
Set all items to No.
In Solution Explorer, in the MySetup project, open Define Setup Requirements and Actions \ Requirements. The Requirements window opens.
Right click System Software Requirements and select Create New Launch Condition. The System Search Wizard appears.
In the What do you want to find? pane, choose Registry Entry in the drop-down list and click Next.
In the How do you want to look for it? pane, select HKEY_LOCAL_MACHINE as the registry root. Enter SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\14.0\isoshell for 64-bit systems or SOFTWARE\Microsoft\DevDiv\vs\Servicing\14.0\isoshell for 32-bit systems, and enter Install as the registry value. Click Next.
In the What do you want to do with the value? pane, enter This product requires the Visual Studio 2015 Isolated Shell Redistributable to be installed. as the display text and click Finish.
Rebuild the isolated shell solution to create the setup project.
You can find the setup.exe file in the following folder:
Testing the Installation Program
To test the setup, copy the setup.exe file to a different computer and run the Setup executable. You should be able to run the isolated shell application.