In my last post I’ve shown how to create a project template from an existing project by exporting it. Now we will go through the creation of a simple VSIX to package our project template.
Steps before creating a VSIX project
- Install the Visual Studio 2013 SDK which you can download from here.
- If you have not created a project template before, read this post.
Creating the VSIX project
1. Open the New Project menu through File / New / Project
2. Select the Visual C# / Extensibility / VSIX project which is available after installing the SDK.
3. When the project is created the source.extension.vsixmanifest file is automatically opened in design mode.
4. The only required fields are the following:
- Product Name: The name that will appear in the Extension manager.
- Product ID: Unique identifier of the VSIX. It is a good idea to leave the GUID in it making sure it has a unique as Extension Manager uses this ID to check if it has an update.
- Description: The description that will be displayed in the Extension manager.
5. Next we need to add the project template zip file to the assets, to do this go to the Assets tab at vsixmanifest Design view and click on the New button.
6. In the popup window you should select the following values where the template file should be the one which you exported from the MiniCrawler project (by default found at C:\Users\(username)\Documents\Visual Studio 2013\Templates\ProjectTemplates):
7. After clicking the OK button, the file is automatically added to the project inside the ProjectTemplates folder.
8. Now, build the solution and at the Debug or Release folder, there will be a MiniCrawlerVSIX.vsix file, that you can use to install this project template. As this name looks a bit silly, I recommend to change the Assembly name in the project properties to MiniCrawler so the VSIX file won’t contain the VSIX suffix.