How to Create Visual Studio 2012 Custom Templates

Lately, I’ve been thinking about ways to manage and re-use existing code. Right away I thought of code snippets. Snippets are handy for methods or small segments of code, but what I was really looking for was a faster way to repurpose common class libraries and patterns.
Functionality such as caching, logging, abstracting the SharePoint data layer, etc. are a few examples of what tend to be boilerplate code. It would be great to have a pre-defined “Base” project that can be repurposed (and improved over time) to help speed up SharePoint development.
One way to achieve this is by creating a custom Visual Studio 2012 Project Template. Visual Studio provides a painless process to make this happen. And automatically handles the parameterization of namespaces for you.
Here’s a quick set of instructions to walk you through the process:
Step 1: Find an existing project or create a new one that you would like to use as a template. In this example I called mine “SharePoint.Base”.
Step 2: Export as a template. File –> Export template.
Step 3: Save as Project template.
Step 4: Select Template Options. I named my template “SharePoint Class Library”.
Step 5: Create a new project based on your template.
That’s it! You now have a custom template that can be modified to meet your development needs.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Steven Mierop

As a Lead Technical Consultant at Perficient, I've had the pleasure of designing and delivering custom solutions on SharePoint 2007-2013. I have a strong passion for web application development and the .NET framework. Over the past three years, I have implemented a variety of SharePoint and .NET solutions for clients in a wide range of Industries such as Health Care, Insurance, Pharmaceutical, and Publishing.

More from this Author

Subscribe to the Weekly Blog Digest:

Sign Up
Follow Us