I suggest you ...

allow the Global keyword for namespace declarations in VB.NET

Request:

It should be possible to define a namespace like this:

Namespace Global.MyCompany.MyLibrary

'my code

End Namespace

Meaning that the specified namespace (MyCompany.MyLibrary) is an absolute Namespace and should ignore the default namespace defined at project level.

Reason:

If I have a VB.NET - project with a default namespace, say "MyCompany.MyProduct" and 50 files representing classes, enums etc. and now there comes one new class that thematically belongs to another assembly (say "MyCompany.MyLibrary"), but because of cross-reference-restrictions I have to include in this assembly but with the namespace of the other one, then I have to remove the the default namespace from the project and add 50 times a

Namespace MyCompany.MyProduct
End Namespace

around all my existing code which is less-than-ideal, and also if I (or the marketing department) decides for a better name right before shipping, then I have to replace the namespace again 50 times...

0 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Chris shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Chris,

I feel your pain. You’re right, one shouldn’t have to redo their entire project to add a one-off namespace. Happily, as another has mentioned already this has been fixed in VB2012 http://blogs.msdn.com/b/vbteam/archive/2011/09/27/announcement-namespace-global.aspx

You can now use the Global keyword as the root of a namespace declaration.

Regards,

Anthony D. Green, Program Manager, Visual Basic & C# Languages Team

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base