Cloud

How to Create Visual Studio 2012 Custom Templates

Microsoft - The Essential Guide to Microsoft Teams End-User Engagement
The Essential Guide to Microsoft Teams End-User Engagement

We take you through 10 best practices, considerations, and suggestions that can enrich your Microsoft Teams deployment and ensure both end-user adoption and engagement.

Get the Guide

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”.
baseProject
Step 2: Export as a template. File –> Export template.
File-export-template
Step 3: Save as Project template.
choose-template
Step 4: Select Template Options. I named my template “SharePoint Class Library”.
template-options
Step 5: Create a new project based on your template.
new-template
That’s it! You now have a custom template that can be modified to meet your development needs.

About the Author

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

Leave a Reply

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

Subscribe to the Weekly Blog Digest:

Sign Up