How can I list all the classes in my current project(assembly?) using reflection? thanks.
How can I list all the classes in my current project(assembly?) using reflection? thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Given an instance
aof System.Reflection.Assembly, you can get all types in the assembly using:This will give you all types, public, internal and private.
If you want only the public types, you can use:
If you are running this code from within the Assembly itself, you can get the assembly using
GetTypes and GetExportedTypes will give you all types (structs, classes, enums, interfaces etc.) so if you want only classes you will have to filter