c# - What are the different ways to know which all classes and methods present in a DLL? -


i in interview , interviewer asked me below question.

how know classes , methods present in dll ?

i confused , said, "we can use tool or refactor that."

can explain different ways find dll (from code tools)

i suspect interviewer referring reflection. example:

var assembly = ...; // e.g. typeof(sometype).assembly var types = assembly.gettypes(); var methods = types.selectmany(type => type.getmethods()); // etc 

you'd need filter types using type.isclass classes, example. linq useful when working reflection query specific parts of type or assembly. note parameterless getmethods() call above return public methods; can specify bindingflags value retrieve non-public methods well.


Comments