Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio auto-including (C#)

Is there a way to specify which namespace "includes" should be automatically added any time you create a new C# file in Visual Studio 2008?

Thanks!

like image 273
Chris Avatar asked Jan 23 '23 06:01

Chris


2 Answers

Yes you can edit the visual studio templates.

you can locate the templates for c# in: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp

Each template is in a zip file just edit the desired file in the archive.

Hope this helps.

like image 147
Claudiu Mihaila Avatar answered Feb 01 '23 10:02

Claudiu Mihaila


SUggest you look at ReSharper.. from JetBrains Inc ( )

it suggests, and then automatically adds namespaces for you when you add a reference to a new class that needs one, as well as many many other productivity enhancements.

like image 34
Charles Bretana Avatar answered Feb 01 '23 08:02

Charles Bretana