Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating default set-ups for commonly used code in Visual Studio 2010?

This is a pretty minor annoyance, but I noticed that every time I create a class in Visual Studio there are a few things that I would like to be automatically-generated for me. For instance, all of my classes start with a log4net declaration. It's only one line of code, but it's annoying having to find a class where I declared it in to copy/paste from.

In addition, there are multiple common 'usings' which I use, but that are not created by default.

Is it possible to setup VS to do this?

like image 537
Sean Anderson Avatar asked Dec 27 '22 17:12

Sean Anderson


2 Answers

You just need to edit the default Visual Studio Class template. A walkthrough of the process can be found here.

like image 65
ahawker Avatar answered Jan 17 '23 18:01

ahawker


From the File menu, select "Export Template".

like image 40
LarsTech Avatar answered Jan 17 '23 17:01

LarsTech