[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

How to enumerate all classes in an assembly?

Siegfried Heintze

10/16/2002 5:16:00 PM

The source code to OleCOMViewer (available with the C++ compiler) shows how
to load a COM DLL and enumerate all the classes, constants, enumerations,
and functions in it.

I want to write a program that loads a .NET DLL (assembly?) and enumerates
the contents.

Is there a counterpart to OleCOMViewer that does this? Is source code
available for it?

(I presume that if I could enumerate the classes, I could load them and use
reflection. Do all .NET classes support reflection?)

I tried using OLECOM viewer on a DLL I exported from .NET, but that did not
work -- I received all kinds of errors.

Thanks,
Siegfried


2 Answers

TJoker.net

10/16/2002 5:30:00 PM

0

If you just wank to use an existing tool you can use ILDASM.exe that is
usually at:
c:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin
If you want to develop you own application you should start looking in the
System.Reflection namespace. Playing with the types in that namespace will
easily allow you to do what you want.

--
_________________________________________
TJoker, MCSD
Chicago-based .NET developer
mailto:sergio_pereira@msn.com
-----------------------------------------


"Siegfried Heintze" <siegfried@heintze.com> wrote in message
news:uqr479n2972i45@corp.supernews.com...
> The source code to OleCOMViewer (available with the C++ compiler) shows
how
> to load a COM DLL and enumerate all the classes, constants, enumerations,
> and functions in it.
>
> I want to write a program that loads a .NET DLL (assembly?) and enumerates
> the contents.
>
> Is there a counterpart to OleCOMViewer that does this? Is source code
> available for it?
>
> (I presume that if I could enumerate the classes, I could load them and
use
> reflection. Do all .NET classes support reflection?)
>
> I tried using OLECOM viewer on a DLL I exported from .NET, but that did
not
> work -- I received all kinds of errors.
>
> Thanks,
> Siegfried
>
>


Michael Lang

10/16/2002 7:53:00 PM

0

yes, ALL types in .NET (including ones you make) support reflection.
reflection support is part of the platform, not via interfaces that you
implement. However, you can add attributes to classes.methods, etc... that
can also be queried using reflection.

"Siegfried Heintze" <siegfried@heintze.com> wrote in message
news:uqr479n2972i45@corp.supernews.com...
> The source code to OleCOMViewer (available with the C++ compiler) shows
how
> to load a COM DLL and enumerate all the classes, constants, enumerations,
> and functions in it.
>
> I want to write a program that loads a .NET DLL (assembly?) and enumerates
> the contents.
>
> Is there a counterpart to OleCOMViewer that does this? Is source code
> available for it?
>
> (I presume that if I could enumerate the classes, I could load them and
use
> reflection. Do all .NET classes support reflection?)
>
> I tried using OLECOM viewer on a DLL I exported from .NET, but that did
not
> work -- I received all kinds of errors.
>
> Thanks,
> Siegfried
>
>