473,382 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Default namespace confusion

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.

Aug 17 '06 #1
2 1719
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.
--
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#
"sh******@cs.fsu.edu" wrote:
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.

Aug 17 '06 #2
Thanks!

Aug 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: J.R. | last post by:
Hi folks, The python can only support passing value in function call (right?), I'm wondering how to effectively pass a large parameter, such as a large list or dictionary? It could achieved...
3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
1
by: Phill. W | last post by:
Having changed a VB.Net(2003) DLL project, I'm getting Type Loading problems in other code that uses my DLL. In my source code, I have a Namespace Statement something like this: Namespace...
15
by: John Salerno | last post by:
Forgive my newbieness, but I don't quite understand why Unicode is still something that needs special treatment in Python (and perhaps elsewhere). I'm reading Dive Into Python right now, and it...
12
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST>
6
by: vivekian | last post by:
Hi, I am not sure if this is a relevant topic here, anyways, When using the std namespace is it a good practice to .. put this right at the beginning using namespace std ;
4
by: Ross Presser | last post by:
I'm feeling very stupid about this ... pdf2html (http://pdf2html.sourceforge.net) is an app that reads a PDF and can generate HTML or XML; in my case I'm using the XML. The PDF I'm working with...
10
by: Brad Baker | last post by:
I have an asp.net/csharp application that requires a particular variable to work properly. This variable is usually passed via a query string in the URL when the application is first run but under...
2
by: cj | last post by:
What does the line <System.Web.Services.WebService(Namespace:="http://tempuri.org/")_ do in the example below? Imports System.Web.Services Imports System.Web.Services.Protocols Imports...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.