Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

Default namespace confusion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shumaker@cs.fsu.edu - 17 Aug 2006 15:29 GMT
I'm confused about the default namespace setting in the project
properties.  Help has the following:

"Default namespace
Specifies the base namespace for all files in the project. For example,
if you set the root namespace to Project1 and you have a Class1 outside
of any namespace in your code, its namespace would be Project1.Class1.
If you have a Class2 within a namespace Order in code, its namespace
would be Project1.Order.Class2."

This would imply if I have

namespace Foo{
class Bar{...}
}

And set my default namespace to "Grand", then I thought my class should
appear as Grand.Foo.Bar, but it seems to just be Foo.Bar

So I'm not at all sure now what the default namespace does.
David Anton - 17 Aug 2006 15:52 GMT
The default namespace in C# does not have the same meaning as the VB default
namespace.  In C#, all it means is that this namespace will be added by
default to new classes you create (i.e., the text "namespace Foo" will be
added to the file).

In VB, it means that everything in the project is implicitly within the
default namespace.
Signature

David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
C# Code Metrics: Quick metrics for C#

> I'm confused about the default namespace setting in the project
> properties.  Help has the following:
[quoted text clipped - 16 lines]
>
> So I'm not at all sure now what the default namespace does.
shumaker@cs.fsu.edu - 30 Aug 2006 18:19 GMT

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.