PC Review


Reply
Thread Tools Rate Thread

Determine current namespace

 
 
vooose
Guest
Posts: n/a
 
      7th Feb 2005
Does anyone know how to determine the current namespace in code?

This appears to be necessary when you obfuscate your code and it changes
the namespace, so references to 'OldNameSpace' are now invalid. (say
when you are loading resources from a folder within the dll)

--
Wal
http://www.vooose.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Bruce Wood
Guest
Posts: n/a
 
      7th Feb 2005
How about

this.GetType().Namespace

?

 
Reply With Quote
 
vooose
Guest
Posts: n/a
 
      7th Feb 2005
Seek and ye shall find...

Type type = typeof(MyClass);
string namespace = type.Namespace;

--
Wal
http://www.vooose.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
vooose
Guest
Posts: n/a
 
      8th Feb 2005
Thanks Bruce, thats even betterer.

--
Wal
http://www.vooose.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine the default namespace of a project in code Patrick Blackman Microsoft C# .NET 0 2nd Sep 2005 01:43 AM
Determine all classes within a namespace jw56578@gmail.com Microsoft C# .NET 2 14th Mar 2005 09:48 PM
Get Current NameSpace Steve Microsoft C# .NET 2 1st Jan 2005 02:35 PM
Resolving current namespace Glen Microsoft C# .NET 2 15th Dec 2004 09:48 PM
Determine namespace of assembly Chris Becker Microsoft C# .NET 3 7th Nov 2003 11:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:45 PM.