G
Guest
The Assembly class has a GetReferencedAssemblies method that returns the
referenced assemblies. Is there a way to find what Types are referenced?
referenced assemblies. Is there a way to find what Types are referenced?
Doug said:I am not interested in ALL the types in the referenced assembly. I only
want
the types that I referenced. For example:
Assembly A:
object x = new Thing1();
Assembly B:
class Thing1() { ... }
class Thing2() { ... }
class Thing999() { ... }
I need something like this:
Assembly x = (reference to Assembly A);
Type[] refTypes = x.GetReferencedTypes();
refTypes should contain only Thing1; not Thing2, Thing999, etc.
Sorry I wasn't more explicity in my original posting.
Vadym Stetsyak said:You can get the types that are in the referenced assembly.
To find what types are referenced you have to operate on the level of
source
code ( parse source code, get type declarations and search the
assessmblies
they are stored in )
Another way is using reflection to iterate through class and get info
about
params and return types etc. However you'll miss methods body, where the
type can be used.
referenced assemblies. Is there a way to find what Types are referenced?
Doug said:I am not interested in ALL the types in the referenced assembly. I only want
the types that I referenced. For example:
Assembly A:
object x = new Thing1();
Assembly B:
class Thing1() { ... }
class Thing2() { ... }
class Thing999() { ... }
I need something like this:
Assembly x = (reference to Assembly A);
Type[] refTypes = x.GetReferencedTypes();
refTypes should contain only Thing1; not Thing2, Thing999, etc.
Sorry I wasn't more explicity in my original posting.
Vadym Stetsyak said:You can get the types that are in the referenced assembly.
To find what types are referenced you have to operate on the level of source
code ( parse source code, get type declarations and search the assessmblies
they are stored in )
Another way is using reflection to iterate through class and get info about
params and return types etc. However you'll miss methods body, where the
type can be used.
--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com
referenced?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.