473,385 Members | 1,912 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,385 software developers and data experts.

Root Namespace

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
Nov 20 '05 #1
3 3072
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" <as*@abc.com> wrote in message
news:vk************@corp.supernews.com...
[Assembly].GetExecutingAssembly.GetName.Name

hth,

steve
"Lee Moody" <no****@nospam.com> wrote in message
news:09****************************@phx.gbl...
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


Nov 20 '05 #2
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 bedifferent.

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

Please respond to the newsgroup,
so all can benefit
"steve" <as*@abc.com> wrote in message
news:vk************@corp.supernews.com...
[Assembly].GetExecutingAssembly.GetName.Name

hth,

steve
"Lee Moody" <no****@nospam.com> wrote in message
news:09****************************@phx.gbl...
> 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


.

Nov 20 '05 #3
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'"
"Lee Moody" <no****@nospam.com> wrote in message
news:0b****************************@phx.gbl...
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 bedifferent.

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

Please respond to the newsgroup,
so all can benefit
"steve" <as*@abc.com> wrote in message
news:vk************@corp.supernews.com...
[Assembly].GetExecutingAssembly.GetName.Name

hth,

steve
"Lee Moody" <no****@nospam.com> wrote in message
news:09****************************@phx.gbl...
> 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


.

Nov 20 '05 #4

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

Similar topics

4
by: cplusplus | last post by:
Hello, I have newbie question. I'm stuck on this current assignment. Write a program that prompts the user for two integer values, passes the values to a function where they are multiplied...
6
by: David B. Bitton | last post by:
I am having a problem deserializing XML when the root node is missing a namespace declaration. My Type has an XmlTypeAttribute with a namespace defined. If I attempt to deserialize the XML, I get...
4
by: Sebastien Tardif | last post by:
Subject: XmlSerializer.Deserialize complain when root declare the namespace If I do XmlSerializer.Deserialize( myString ) and myString is: String myString = "<?xml version=\"1.0\"...
5
by: Cal | last post by:
Should the Root Namespace be something like Microsoft. Or maybe Microsoft.MyControl I think the root applies only to things defined in the project. Nothing to do with namespaces referenced...
3
by: CCJohn | last post by:
Hi, I find that while I can use the "Namespace...End Namespace" inside my code, there is also a "Root namespace" field in the project properties dialog box under General. So where should I put...
2
by: Jeff Brown | last post by:
Hi, I suspect that this isn't possible, but I figured I'd ask. My project has a root namespace, let's say it's "Root", that applies to almost every source file (which is why I've set it as the...
16
by: TT (Tom Tempelaere) | last post by:
Hi all, I created an XSD to define the structure of an XML file for my project. I made an XML file linked to the XSD using XmlSpy. The problem is that if I read the file using .NET XmlDocument...
2
by: gabe | last post by:
Hi, We have a number of projects that will use the default 'Root Namespace' option in the project properties box. There will be a common Master Page that will be used among the projects. I'd...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.