[Mono-list] Corlib and GetTypes()

Nick Drochak ndrochak@gol.com
Tue, 1 Jan 2002 22:17:38 +0900


I was trying to prototype a system to find out what types are missing
from corlib vs. mscorlib.  I used a code fragment such as:
  Assembly monoAsmbl =
  Types[] t = monoAsmbl.GetTypes();

On the second line above a ReflectionTypeLoadException is thrown.  It
seems that since mscorlib is already loaded, there is a problem
examining an different assembly having types which already exist in

To work around this, I thought I could create a new AppDomain in which
to load the mono corlib assembly and have that AppDomain examine mono's
corlib.  However, I got stuck because when I do
AppDomain.CreateDomain(), mscorlib is automatically loaded into the
newly created AppDomain.  I determined that by this code fragment:
  AppDomain child = AppDomain.CreateDomain("childapp", null, null);
  Assembly[] asses = child.GetAssemblies();
  foreach(Assembly a in asses){
    Console.WriteLine("Ass: " + a.FullName);

Perhaps there is a way to prevent the loading of mscorlib, or perhaps
there is another/better way to examine mono corlib's types.

Any suggestions?

Nick D.