1
votes

In Visual Studio 2012, when I add a new class to my project, it automatically comes with some namespaces (System, System.Collections.Generic, System.Linq and System.Text).

I always use System.Data and I want this namespace in all my classes. My question is this: How can I configure that all my new classes already comes with that namespace in top of it?

I'm sorry if my question wasn't clear enough. Thanks in advance!

1
FYI. If you're referring to the using System; lines at the top of the file, those are namespaces, not dll/libraries. One dll/library (that gets referenced at the project level) could contain many namespaces.George Duckett
Thanks for the info George, I really was in doubt about that name.. But, just to be clear, the only way to do what I want is editing the template for new classes?Everton Lenger

1 Answers

0
votes

actually it depends upon the template you are using that which namespace need to import or not. There is not direct way to do this.

Change the existing template.

goto the location

%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\itemtemplatescache\CSharp\Code\1033\Class.zip

or

%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\itemtemplatescache\CSharp\Code\1033\Class.zip

or if you are still confuse search the folder Class.zip and open it and change the template. :)