Skip to content

How to create your own template pack

Tyler Hughes edited this page May 22, 2015 · 8 revisions

Prerequisites

  • Visual Studio SDK for the version of Visual Studio you will be using
  • SideWaffle Template Pack

Create your project

5 minute video

create-proj-templates-video-image.jpg

  1. To get started create a new project File > New Project using either the Visual Studio Package project template OR the VSIX project template. The difference between the two is that the Visual Studio Package project will give you the ability to modify the IDE by adding commands or menus, etc and has a nice wizard walkthrough when you create the project to get things set up. This tutorial assumes we are using the VSIX project template.

  2. Once you have chosen a name and clicked OK to create the project, you will taken to a form with the data from your .vsixmanifest. Fill out the Author text box with your name or the name of your organization and save. Feel free to fill in any other details you want in order to provide additional metadata about your template pack.

  3. Open up the Package Manager Console and install the prerelease version of the TemplateBuilder package

    install-package TemplateBuilder
    

Snippet Support

  1. Add a .pkgdef file (from the SideWaffle project) to the root of your project.

  2. In the .pkgdef file, add a section for each language you want to support

    // Example:
    // C#
    [$RootKey$\Languages\CodeExpansions\CSharp\Paths]
    "MyTemplatePack"="$PackageFolder$\Snippets\CSharp\MyTemplatePack"
    
    // SQL - SQL Server Data Tools in VS
    [$RootKey$\Languages\CodeExpansions\SQL_SSDT\Paths]
    "MyTemplatePack"="$PackageFolder$\Snippets\SQL_SSDT\MyTemplatePack"
    
  3. Next we need to add the file to the our manifest's assets. Open up the .vsixmanifest file and click on the Assets tab. Click the New button and enter in the following information:

    Field Value
    Type Microsoft.VisualStudio.VSPackage
    Source File on filesystem
    Path Path to your .pkgdef file.

TODO: Writeup on Item Templates

TODO: Writeup on Project Templates

For the latest method on creating project templates see the video at https://www.youtube.com/watch?v=z33jOo75CH4&feature=youtu.be

For now checkout the blog post at http://sedodream.com/2013/10/11/SideWaffleHowToCreateYourOwnVSTemplatePack.aspx.