Root Namespace

L

Lee Moody

Does anyone know where I can access programmically the
value stored in the "Root Namespace" parameter of the
project's common properties? To find this within the IDE,
select your project name under the solution explorer,
right click, select properties, the first form that comes
up has the value stored in the "Root Namespace" field. I
need to find out how to find this value using code.

Thanks in advance.

-Lee
 
T

Tom Spink

Hi, No. That get's the name of the Assembly. The Root Namespace is/can be
different.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit


steve said:
[Assembly].GetExecutingAssembly.GetName.Name

hth,

steve


Lee Moody said:
Does anyone know where I can access programmically the
value stored in the "Root Namespace" parameter of the
project's common properties? To find this within the IDE,
select your project name under the solution explorer,
right click, select properties, the first form that comes
up has the value stored in the "Root Namespace" field. I
need to find out how to find this value using code.

Thanks in advance.

-Lee
 
L

Lee Moody

And in fact, in my case, it is different. Any ideas where
to find the Root Namespace?

-Lee
-----Original Message-----
Hi, No. That get's the name of the Assembly. The Root Namespace is/can be
different.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit


steve said:
[Assembly].GetExecutingAssembly.GetName.Name

hth,

steve


Lee Moody said:
Does anyone know where I can access programmically the
value stored in the "Root Namespace" parameter of the
project's common properties? To find this within the IDE,
select your project name under the solution explorer,
right click, select properties, the first form that comes
up has the value stored in the "Root Namespace" field. I
need to find out how to find this value using code.

Thanks in advance.

-Lee


.
 
T

Tom Spink

An idea comes to mind... This *might* work:

Dim strNamespace As String = GetType(AClassInYourAssembly).FullName

strNamespace = strNamespace.Substring(0, strNamespace.IndexOf("."c) - 1)

(The c after "." is deliberate)

But please note, if the root namespace contains other levels, e.g.
my.namespace, then only my will be returned. There is physically no way to
retrieve the value that is set, as each class is simply compiled into the
namespace.

Note: This code is absolutely untested.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"


And in fact, in my case, it is different. Any ideas where
to find the Root Namespace?

-Lee
-----Original Message-----
Hi, No. That get's the name of the Assembly. The Root Namespace is/can be
different.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit


steve said:
[Assembly].GetExecutingAssembly.GetName.Name

hth,

steve


Lee Moody said:
Does anyone know where I can access programmically the
value stored in the "Root Namespace" parameter of the
project's common properties? To find this within the IDE,
select your project name under the solution explorer,
right click, select properties, the first form that comes
up has the value stored in the "Root Namespace" field. I
need to find out how to find this value using code.

Thanks in advance.

-Lee


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top