Results 1 to 5 of 5

Thread: [2.0] Resolve Namespace Library Location

  1. #1

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    [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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    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?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    Resolved 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
  •  



Click Here to Expand Forum to Full Width