Limiting default namespaces ...

R

Raj

How to limit the number default namespaces included in any of my .net project
(C#, ASP.net ...)? I need this as most of the many of the namespaces are not
being used.

Thank you

Regards
Raj
 
J

Jeroen Mostert

How to limit the number default namespaces included in any of my .net project
(C#, ASP.net ...)? I need this as most of the many of the namespaces are not
being used.
If they're not used, why do you bother? There's no tax on imported namespaces.

That said, you *can* change this -- it involves changing the default project
item templates. You can find them in %ProgramFiles%\Microsoft Visual Studio
9.0\Common7\IDE\ItemTemplates (for Visual Studio 2008). You may need to
clear out \Common7\IDE\ItemTemplatesCache before Visual Studio picks up your
changes, although it should do this automatically.

Be careful and make sure to backup these directories first, because damaging
them will render you unable to add new items from Visual Studio.
 
F

Family Tree Mike

How to limit the number default namespaces included in any of my .net project
(C#, ASP.net ...)? I need this as most of the many of the namespaces are not
being used.

Thank you

Regards
Raj

I think this depends on the version of Visual Studio (ie, express may
not offer it).

Right click your code in the editor, and on the context menu, select
"Organize Usings", then on the pop-out, select "Remove Unused Usings".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top