Reflection and UserControls

I can use reflection to load an assembly and get all the types but what i cannot do is find any class in the assembly that is a usercontrol.


Can anyone help?
cossy74Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
Have you tried something like:
            Assembly asm = Assembly.LoadFile(@"C:\someAssembly.dll");

            Type[] types = asm.GetTypes();
            foreach (Type t in types)
            {
                if (t.BaseType.Equals(typeof(System.Web.UI.UserControl)))
                {
                    Console.WriteLine(t.Name + " is a user control");
                }
            }

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.