That depends on what you mean. Are you trying to find the class
according to the folder in which it's contained? If so, then the answer
is you don't. The folders you see in the Solution Explorer have nothing
to do with the compiled output. That information simply doesn't exist
in the assembly.
If you follow the IDE convention, and correlate the folders with
namespaces, then you can organize the types found in the assembly by
namespace, which will then necessarily also match the folders. But the
moment you or someone else neglects to ensure that every type in every
source file contained in every folder of the solution is declared in the
namespace that corresponds with the folder hierarchy, that approach will
fail to show you the folder hierarchy.
If all you want is to use a type for which you already know the name or
other criteria, then that's easy. Just call the GetTypes() on the
Assembly instance you've loaded and search for the type you want in the
returned list based on whatever criteria is relevant to your needs
(name, class members, interface implementations, etc.).
Pete
Thanks for the response. I have obviously set up the name spaces in
each and every class but I am new to reflection and am having trouble
with GetTypes. I can load the assembly using Assembly.LoadFrom("D:
\Test\MyAssembly.dll") but when I call GetTypes I am receiving the
following error: {"Could not load file or assembly
'SomeAssembly.Interfaces, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The system cannot
find the file specified.":"SomeAssembly.Interfaces, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null"}. This is one of many dependant
assemblies within the main assembly I loaded above. If anyone can
help explain this error is would be appreciated.