471,330 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

Visual Studio generated namespaces

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?
Aug 26 '08 #1
3 1222
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.ha...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
Aug 26 '08 #2
Clive Dixon wrote:
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"
--

Aug 26 '08 #3
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.

"Marc Gravell" <ma**********@gmail.comwrote in message
news:64**********************************@i76g2000 hsf.googlegroups.com...
>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.ha...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

Aug 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jan Michalski | last post: by
54 posts views Thread by m.roello | last post: by
8 posts views Thread by WT | last post: by
4 posts views Thread by kurt.kurtsmith | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.