[Mono-list] Assembly reflection oddness
John Barnette
jbarn@httcb.net
Tue, 8 Jan 2002 11:42:55 -0700
Guys,
I'm working on some stuff that iterates over all the types in an assembly,
and all the members of each of those types. While the code works on all
other assemblies I've tried, it explodes when run on a comparable version of
our corlib.
A minimal example follows. Will anybody who's interested in helping
preserve my sanity try it out on Nick's comparable version of the corlib
(corlib_cmp.dll) and some other random assembly?
I'm pretty much out of ideas here. Thanks!
~ j.
--- CUT ---
using System;
using System.Reflection;
class AssemblyLoadTest
{
public static void Main(string[] args)
{
Assembly assem = Assembly.LoadFrom(args[0]);
Type[] types = assem.GetTypes();
foreach (Type t in types) {
Console.WriteLine(t.FullName);
MemberInfo[] members = t.GetMembers();
foreach (MemberInfo m in members) {
Console.WriteLine(" " + m.Name);
}
}
}
}