Hello, I have a DLL that contains several interfaces. I am trying to get the function signatures of all the functions that are implemented in these interfaces.
If anybody could show me an easy way how to do this right, I would really appreciate it.
Printable View
Hello, I have a DLL that contains several interfaces. I am trying to get the function signatures of all the functions that are implemented in these interfaces.
If anybody could show me an easy way how to do this right, I would really appreciate it.
Try to download RedGate's .NET Reflector you can get a free version of it off download.com.
well, you see, I have something like this:
This gives me pretty much what I want, however, I figured that some of the interfaces do have base types and I can't read them.Code:Assembly asm = Assembly.LoadFile("mydll.dll");
attributes = asm.GetExportedTypes();
foreach (Type type in typelist)
{
rt.Text += type.ToString();
MemberInfo[] memlist = type.GetMembers();
rt.Text += "------Members-----";
rt.Text += "\n";
foreach (MemberInfo mem in memlist)
{
rt.Text += mem.ToString();
}
}
Any suggestions ?
Well you'll need to check the BindingFlags parameter of type.GetMembers(). It filters out a lot of the members and properties etc... if you just leave it with the default value.
Yea, I played around with that. No luck.
If you want the base class members do this
Code:type.BaseType.GetMembers()
Thanks for your help. My problem was that I was actually not looking for a base type but rather a sub type.
Thanks for your help though.
reflector will give you types derived from your interfaces (assuming they're in the dll you're speaking of).