No waffling here... SideWaffle and a step-by-step guide to create Visual Studio Item Templates

I can't believe I've not seen or highlighted SideWaffle before. Visual Studio Project and Item templates can be a HUGE time saver. I use them almost every day (well at least almost every week) and very often take that extra few minutes to craft new templates.

You know how it is, right? Dev's who take one hour to save a few minutes? But you also know those few minutes very quickly add up to more than that one hour. You all know "The Rule of Three?" Do it once manually, makes sense. Do it twice manual, hum... Three times? Time to invest to automate or streamline it.

One of the problems with Project or Item templates is that your personal or company is likely pretty unique in your needs. So you need a way to quickly create and share them. But how do you get started?

Richard Kerslake helps with just that...

A step by step guide to developing Visual Studio item templates using SideWaffle

At the moment, endjin are working hard on a new Azure based content management system. It is an exciting and modern solution that is rapidly approaching an alpha release. A large part of how this product works is through the use of plugins. As part of creating an excellent developer experience, we wanted to create a set of templates that can be used to unfurl different types of base plugin into a Visual Studio solution.

It is possible to use a  VSIX Project and the TemplateBuilder nuget package to create a Visual Studio extension, which when installed makes a set of item templates available in the “Add New Item” menu in Visual Studio.

The following steps will guide you through that process:

Download and install the Visual Studio 2013 SDK. Among other things, this will make the VSIX project template available to you. The VSIX project template is also available if you are using 2012 or 2010....

In Visual Studio, create a new VSIX Project ...

...

Install the TemplateBuilder package,...

...

At this point, we could manually create some files to set up our template. However, I’d suggest installing the SideWaffle template pack. This extension adds a whole selection of project and item templates to your Visual Studio. It also adds templates to aid you in creating more templates! (At this point I start hearing “We need to go deeper!” in a Leonardo Di Caprio voice…)

...

Add a new item to the “SampleCategory” folder (Ctrl-Shift-A or right click, Add, New Item).

In the “Add New Item” window, search for “sidewaffle”, or pick the Extensibility category. You’ll see a “SideWaffle Item Template”. Select it, change the name to whatever you want your new template to be called, and hit Add.

image

...

There are a number of built-in parameters that you can use. See the template schema reference and template parameters reference for more details. It is also possible to use custom parameters and a custom wizard, which I could go into in more detail in the future.

We’ve now completed everything for the VSIX project, so let’s build it. This generates a vsix extension installer in the build output folder

...

You could add many more templates to the same VSIX project, to create a library of template types specific to your purposes. To deliver this template package to other people, just hand out the vsix, host it somewhere yourself, or upload it to the Visual Studio extension gallery.

Simple, yet awesome!

[Click through to read the whole post (yes, you'll want too)]

Besides helping creating Item templates, where else does SideWafle help?

SideWaffle

Templates for Visual Studio 2012/2013

Download a delicious side dish for Visual Studio

SideWaffle is an extension

The SideWaffle extension adds a bunch of useful Snippets, Project- and Item Templates to Visual Studio. The purpose is to make your daily work in Visual Studio a richer and more productive experience.

Content

  • Project templates
    • Basic Scaffolder
    • Blank App
    • Browser Link Extension
    • Browser Link Extension (simple)
    • Caliburn.Micro WPF Application
    • Code Snippet Extension
    • Console Application Async
    • Durandal451
    • Google Chrome Extension
    • Google Chrome Theme
    • Google Chrome Web Store App
    • HTML5 Boiler Plate v4.3
    • Nancy demo
    • Nancy empty project with ASP.NET host
    • Nancy empty project with ASP.NET host and Razor
    • Nancy empty self hosted
    • Nancy empty self hosted with razor
    • Nancy with ASP.NET host
    • Nancy with ASP.NET host with Razor
    • Nancy with self host
    • Nancy with self host with Razor
    • Template from html5up.net
    • Windows Azure WebJobs Console Application
  • Item templates
    • _preprocess.xml
    • A basic NuGet .nuspec file
    • An advanced NuGet .nuspec file
    • AngularJs Controller using $scope
    • AngularJs Controller using 'Controller as'
    • AngularJs Directive
    • AngularJs Factory
    • AngularJs Module
    • AngularJs TypeScript Controller using $scope
    • AngularJs TypeScript Controller using 'Controller as'
    • AngularJs TypeScript Directive
    • AngularJs TypeScript Factory
    • AngularJs TypeScript Module
    • ASP.NET Scaffolding T4 files.
    • Basic build script
    • Basic props file
    • Basic SignalR Hub and HTML Client Page
    • Basic targets script
    • Browser Link extension (VS2013 only)
    • Build script with NuGet automatic package restore.
    • Caliburn Micro Bootstrapper
    • CKEditor plugin
    • Code Snippet
    • Customize ASP.NET T4 Files
    • DurandalJs Controller
    • DurandalJs main.js
    • DurandalJs Service
    • DurandalJs ViewModel
    • Editor Drop Handler class
    • Empty PowerShell file
    • Favicon .ico File
    • FirefoxOS manifest
    • GruntJS configuration file
    • HTML Smart Tag (VS2013 only)
    • HTML Validator Class (VS2013 only)
    • HTML Whitespace Removal HttpModule
    • Humans.txt File
    • Jasmine Spec and HTML files
    • Jasmine Spec file
    • JavaScript IIFE
    • JavaScript IIFE Module/Namespace
    • jQuery Plugin
    • JSHint Ignore File (.jshintignore)
    • JSHint Rules File (.jshintrc)
    • JSON Schema File
    • JSON Schema Selector Extension
    • Karma Configuration File
    • Knockout Custom Binding
    • Mocha Test Framework
    • Nancy bootstrapper
    • Nancy module
    • Ninject Controller Factory
    • NUnit Fixture
    • Offline Application Cache Manifest
    • Package Definition (.pkgdef)
    • Package.json for NodeJS
    • QUnit Spec and HTML files
    • QUnit Spec file
    • Readme.md File
    • Readme.md Markdown File
    • RequireJs File
    • Robots.txt File
    • SideWaffle Definitions Folder
    • SideWaffle Item Template
    • SideWaffle Project Template Files
    • SVG File
    • TinyMCE plugin
    • TSLint Rules File (tslint.json)
    • VS Command Table (.vsct)
    • Web API 2 Empty Controller
    • WebVTT File
    • Windows Azure Blob Upload Helper
    • Windows Azure Cloud Service Plugin
    • Windows Azure Table Storage Entity
  • Snippets
    • Angular Controller
    • Angular Directive
    • Angular Service
    • Cross Browser Background Linear Gradient
    • Cross Browser Background Radial Gradient
    • Dispose
    • Nancy - Delete
    • Nancy - Get
    • Nancy - Head
    • Nancy - Options
    • Nancy - Patch
    • Nancy - Post
    • Nancy - Put
    • WCF Client Usage

Open Source

SideWaffle is open source and everyone is invited to contribute. The code is on GitHub.

The entire project is 100% community driven.

...

See what I mean about SideWaffle? If you're doing just about anything in Visual Studio there's probably something there for you? And if not, you now also know how to create one for yourself! :)




Tags:

Follow the Discussion

No Comments

Sorry, no comments have been submitted yet.

Please make a comment below or check back later.

Comment on the Post

Already have a Channel 9 account? Please sign in