Visual Studio generated namespaces

  • Thread starter Thread starter Clive Dixon
  • Start date Start date
C

Clive Dixon

VS 2005:

If I create a folder in my project, when I add new classes to that folder,
VS generates a namespace which is the project default namespace concatenated
with the folder name. Is it possible to turn this (immensely infuriating)
feature off so that it just uses the project default namespace regardless of
any folder structure?
 
I was hopeful that a custom template might do it; the content is
controlled by specific tokens in the template file (which you can
create yourself), but it looks like (contrary to the documentation),
$rootnamespace$ actually contains the folder info. One option would be
to use "namespace $projectname$" - if you can live with the namespace
being the same as the project name (which often they might be...).

You can find out about creating your own template here:

http://codebetter.com/blogs/david.hayden/archive/2005/11/06/134343.aspx

The available tokens are listed here:

http://msdn.microsoft.com/en-us/library/eehb4faa.aspx

(see also the 3.0 page - there is some mention there [in the user
content] of unlisted tokens).

Marc
 
Clive said:
this (immensely infuriating) feature off so that it just uses the

I know this doesn't help you, but its nice to know I am not alone in my
annoyance at that "feature"


--
 
Thanks

Hoped there might be a quick way to do it, but I suspected that I would have
to go the roll my own route.
 
Back
Top