How to create project w/o a namespace

  • Follow


Hi - I am trying to create a project w/o a default namespace but can't
seem to get the hang of it ... Any help appreciated.

Happy New Years,
El Squid
0
Reply tired_of_spaghetti 1/1/2010 5:41:31 PM

On 1/1/2010 12:41 PM, tired_of_spaghetti@yahoo.com wrote:
> Hi - I am trying to create a project w/o a default namespace but can't
> seem to get the hang of it ... Any help appreciated.
>
> Happy New Years,
> El Squid

That seems like a weird goal, so I may be misunderstanding your desire.

I don't think you can change the Default Namespace property to "", or 
nothing.  You can delete the Namespace XXX {} from your code.

-- 
Mike
0
Reply Family 1/1/2010 5:53:34 PM


tired_of_spaghetti@yahoo.com wrote:
> Hi - I am trying to create a project w/o a default namespace but can't
> seem to get the hang of it ... Any help appreciated.

As Mike says, it's hard to understand what exactly you're trying to do.

Every type in C# must be in a namespace.  What would the point of 
eliminating the default namespace from the project be?  How is having a 
default namespace causing a problem for you?

Pete
0
Reply Peter 1/1/2010 10:32:36 PM

Just blank out the 'Default namespace' on the project properties dialog.
-- 
David Anton
Convert between VB, C#, C++, & Java
http://www.tangiblesoftwaresolutions.com


"tired_of_spaghetti@yahoo.com" wrote:

> Hi - I am trying to create a project w/o a default namespace but can't
> seem to get the hang of it ... Any help appreciated.
> 
> Happy New Years,
> El Squid
> .
> 
0
Reply Utf 1/2/2010 1:18:01 AM

Types in C# do not need to be in a namespace.
For a small app which does not expose anything publicly, having everything 
in the same namespace doesn't accomplish anything - that extra 'wrapper' is 
not required.
-- 
David Anton
Convert between VB, C#, C++, & Java
http://www.tangiblesoftwaresolutions.com


"Peter Duniho" wrote:

> tired_of_spaghetti@yahoo.com wrote:
> > Hi - I am trying to create a project w/o a default namespace but can't
> > seem to get the hang of it ... Any help appreciated.
> 
> As Mike says, it's hard to understand what exactly you're trying to do.
> 
> Every type in C# must be in a namespace.  What would the point of 
> eliminating the default namespace from the project be?  How is having a 
> default namespace causing a problem for you?
> 
> Pete
> .
> 
0
Reply Utf 1/2/2010 1:20:01 AM

On 1/1/2010 8:18 PM, David Anton wrote:
> Just blank out the 'Default namespace' on the project properties dialog.

In VS 2008 Express and VS 2010 Express Beta 2, this gives the message 
"The entered value for the property 'Default Namespace' is invalid.

-- 
Mike
0
Reply Family 1/2/2010 2:00:13 AM

Strange - I have a project started in VS 2005 and it allowed a blank default 
namespace and the upgrade to VS 2008 left it blank.

For a new project, you can just manually edit the .csproj file so the the 
'RootNamespace' xml entry is blank.
-- 
David Anton
Convert between VB, C#, C++, & Java
http://www.tangiblesoftwaresolutions.com


"Family Tree Mike" wrote:

> On 1/1/2010 8:18 PM, David Anton wrote:
> > Just blank out the 'Default namespace' on the project properties dialog.
> 
> In VS 2008 Express and VS 2010 Express Beta 2, this gives the message 
> "The entered value for the property 'Default Namespace' is invalid.
> 
> -- 
> Mike
> .
> 
0
Reply Utf 1/2/2010 3:01:01 AM

David Anton wrote:
> Types in C# do not need to be in a namespace.

Ah, thanks.  I misread the spec when I looked that up.  Duh.
0
Reply Peter 1/2/2010 5:00:22 AM

7 Replies
615 Views

(page loaded in 0.139 seconds)

Similiar Articles:
















7/13/2012 5:01:13 PM


Reply: