|
-
Oct 20th, 2007, 10:13 AM
#1
Thread Starter
Addicted Member
[2.0] Resolve Namespace Library Location
Hello! I have a quick question, im trying to write a tool that parses a csproj / vbproj file. when it gets to what libraries are referenced i wanted to get the file the namespace belongs to.
EG: It reads in "System.Xml" how can i get the path of where that is stored programitcally
-
Oct 20th, 2007, 07:46 PM
#2
Re: [2.0] Resolve Namespace Library Location
That is simply not possible. There is no specific relationship between namespaces and assemblies. It is common to use the name of the assembly as the root namespace for the project but that is just a convention, NOT a requirement. Not only that, one assembly can contain classes from multiple namespaces. Not only that, one namespace can have its member classes declared in multiple assemblies. As an example, by default a VB project references the System.dll assembly. That assembly contains classes that are members of the System namespace as well as classes from 38 other namespaces. Not only that, classes that are members of the System namespace are also declared in mscorlib.dll, System.Xml.dll, System.Windows.Forms.dll, System.Drawing.dll and System.Web.dll. All those assemblies also contain classes from multiple namespaces.
Assemblies and namespaces are not the same thing and are not specifically related. The same names may be used in some cases but that is for convenience only. Assemblies are a physical separation of types, while namespaces are a logical separation of types.
Now, with that cleared up, what exactly is it that you wanted to do?
-
Oct 21st, 2007, 02:58 AM
#3
Thread Starter
Addicted Member
Re: [2.0] Resolve Namespace Library Location
Thanks for clearing that up. What i'd like to do is from the reference in the project (Xml is below) is find out what library it is that's actaully being referenced.
<Reference Include="CrystalDecisions.Windows.Forms, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL" />
How could i find where that library lives? Is there a reverse lookup for the PublicKeyToken?
-
Oct 21st, 2007, 03:41 AM
#4
Re: [2.0] Resolve Namespace Library Location
Assemblies will almost universally be installed in the global assembly cache (GAC), or else they'll be in the same folder as the assembly referencing them. It is possible to reference assemblies in other locations but it would be extremely rare that that would be done.
-
Oct 21st, 2007, 03:57 AM
#5
Thread Starter
Addicted Member
Re: [2.0] Resolve Namespace Library Location
OK thanks for your help. I'll just leave it. Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|