Where to find and customize the templates Visual Studio uses when creating projects?

Posted: (EET/GMT+2)

 

Today's blog post is a quick tip for any small development shop wanting to quickly tune Visual Studio's built-in project templates to better suit their needs. For instance, if you always find that when starting a new ASP.NET MVC project, you end up doing all the same CSS and image/logo customizations over and over again, it might be worthwhile to directly edit the template files*.

The answer to this question is to learn where Visual Studio's project template files reside. For instance, in Visual Studio 2013, when you create a new ASP.NET MVC web application project, the files that are initially your project files, are loaded from:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\
Common7\IDE\WebTemplates\MVC\CSharp\1033\MvcBasicApplicationv5.0

Armed with this information, you could simply go into this folder, and edit the files (such as image files and CSS style sheets) to the way you prefer. If you wanted to add a couple of files more, you could simply copy them to the correct destination folder, and edit the template file (in this case, named "MvcBasicApplication.cshtml.vstemplate") to contain an entry to the new file you just added.

Pretty straightforward in my opinion. Can save a ton of time, if you create many small projects that are similar to each other.

Hope this helps!

*) This direct approach is only usable if you have a handful of developers, not more. Since all customizations are manual in nature and per-computer at best, this approach doesn't scale well. However, if you just need to add a couple of files to the project or make quick adjustments, this approach is way faster to get done than creating a completely new project template and distributing that to other developers. But in larger settings, this would be your best bet.