Root Namespace

  • Thread starter Thread starter Lee Moody
  • Start date Start date
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
 
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
 
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


.
 
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


.
 
Back
Top