« Adding a Web Service reference to a client project in Visual Studio | Main | SQL Enterprise Manager incorrectly labels view columns. »

C# Namespaces, using directives, "System" is a magic word.

What’s the difference between “using” statements within versus preceeding a namespace block? It seems to be mostly a style preference thing but not entirely. A quick google on the subject found no words of wisdom.

 

Namespaces get weird if you use “System” in your own nested namespace scheme. Using directives then need to preceed Namespace directives and must be comprehensive. Compiler appears to insist on resolving all “System” rooted namespaces relative to the user namespace containing the word “System”.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)