Reputation: 51717
Whenever I add a new class to a Visual Studio (C#) project, I get the following usings automatically:
Additionally, the following DLL references are added if they weren't there already:
I'd like to prevent VS from doing this (except "using System" of course). Does any one know of a way to prevent this from happening?
Upvotes: 14
Views: 5461
Reputation: 51717
Marc and Brian both have a good idea: create a new custom template that includes only the usings and references I want. With Export Template it's really simple to do so, and I'll be sure to do so for all sorts of specific items.
For general-purpose new classes (ie: what you get from the "Add->Class..." menu item in VS), here's what I did to achieve my goal:
<reference>
elements.Now, whenever I add a new class, I get exactly what I want.
Upvotes: 14
Reputation: 118865
You can create your own customized item templates, see
for some details.
Upvotes: 6
Reputation: 1062725
You can change your template files... either by editing the files in the install location, or by writing a class how you want it, and choosing Export Template. There is also a template add-in somewhere...
Upvotes: 10