using .Net Reflector

Please forgive what is surely a stupid question:

How do I use .Net Reflector to find out which namespace a class, method or property is in, or to see parameter lists? There's no way to enter a character string to tell it what you're looking for.


  • Reflector is a technique, it is not realy a class. Actualy, there are ways to .... What you are looking for is Assembly class and Type class:

    Assembly SampleAssembly;
    SampleAssembly = Assembly.LoadFrom("c:\Sample.Assembly.dll");
    // Obtain a reference to a method known to exist in assembly.
    MethodInfo Method = SampleAssembly.GetTypes()[0].GetMethod("Method1");
    // Obtain a reference to the parameters collection of the MethodInfo instance.
    ParameterInfo[] Params = Method.GetParameters();
    // Display information about method parameters.
    // Param = sParam1
    // Type = System.String
    // Position = 0
    // Optional=False
    foreach (ParameterInfo Param in Params)
    Console.WriteLine("Param=" + Param.Name.ToString());
    Console.WriteLine(" Type=" + Param.ParameterType.ToString());
    Console.WriteLine(" Position=" + Param.Position.ToString());
    Console.WriteLine(" Optional=" + Param.IsOptional.ToString());

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion