473,406 Members | 2,894 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,406 software developers and data experts.

retreiving namespace using Reflection | Beginners

Hi,

I want to retreive different namespaces available within an Assembly
using Reflection. Is this possible? Can i retreive a namespace within
an Assembly using " Type " ?

My question is how can we retreive a namespace from an Assembly? For
example, i can see different namespaces with " mscorlib" assembly then
how can retreive namespaces within mscorlib?
Pardon my ignorance and please enlighten me.
Thanks in advance.
-Erland

May 18 '06 #1
1 1334
take a look here
http://msdn2.microsoft.com/en-us/lib....gettypes.aspx

you can get name of returned types' FullName property (as you know it
will start with Namespace) you can perform custom parsing to get what
you need

this is the code for getting all types in executing assembly - you must
have windows forms applciation with TextBox called textBox1 (Multiline
property is set to true)
System.Reflection.Assembly asm = Assembly.GetExecutingAssembly();

Type[] types = asm.GetTypes();
for (int i = 0; i < types.GetLength(0); i++)
{
textBox1.Text = string.Format("{0}{1}{2}",
textBox1.Text, types[i].FullName, Environment.NewLine);

}

I hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

May 18 '06 #2

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

Similar topics

88
by: Tim Tyler | last post by:
PHP puts most of its functions into a big flat global namespace. That leads to short function names - but creates a namespace minefield for programmers. Lots of the functions are legacies from...
3
by: Kelmen Wong | last post by:
Greeting, I'm working on a class managing resources (satelite). public CResMgr() { Assembly objClient = Assembly.GetCallingAssembly(); _objResMgr = new...
2
by: puzzlecracker | last post by:
after reading some of the post I found out something rather radical to my previous understanding: that when you do #include<iostream> #include<string> #include<vector> etc compiler puts...
2
by: Mythran | last post by:
In .Net, how can I go about and set a Crystal Reports namespace? Right now they use the Root Namespace (VB) from the project. How can I extend the namespace for a single report (which will be set...
3
by: Joel Leong | last post by:
How can I use Reflection to get full namespace of my web page? I got a page under this namespace namespace CompanyABC.Admin { public class FruitList: System.Web.UI.Page { } }
6
by: MattC | last post by:
When I add a template column to a DataGrid and bind some data from an object in a collection using the following: <% DataBinder.Eval(Container, "DataItem.Department.DepartmentName") %> What...
6
by: Juha Nieminen | last post by:
Whenever one sees example C++ code basically anywhere, be it in a book, in a tutorial in the internet, in an online forum or whatever, I would estimate that at least in 99% of cases one sees the...
1
by: Dan Holmes | last post by:
I can't find where i have declared ICategoryService as being in the IVS.WMS.Product namespace. I have recompiled. Deleted the obj and bin dirs. Removed the reference. I can't figure out how the...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.