[Mono-list] Reflection Problem

Carlos Alberto Cortez is118149@mail.udlap.mx
20 Mar 2003 03:14:27 -0600


Hello!

My name is Carlos, and I've been playing for a while with reflection.
But when I try to use the Activator.CreateInstance() method, even it
compiles perfect ( no error messages ), when I try to run it, it shows
me the next message:


Unhandled Exception: System.MissingMethodException: Default constructor
not found
in <0x0019b> 00 System.Activator:CreateInstance (System.Type,bool)
in <0x00031> 00 .ReflectionTest:Main ()

The code I'm writing is the next:

using System;
using System.Reflection;

 public class ReflectionTest {

        public static void Main () {

                Type theMathType = Type.GetType("System.Math");
                Object theObj = Activator.CreateInstance(theMathType);

	}
 }

Regards,
Carlos.

-- 
--------------------------------------------------
/* The definition of myself */
using Cortez;
using GeniusIntelligence;

public class Carlos : Human, IGenius, ILinuxUser {

	static void Main () {
		Me.Born();
	}

}

--------------------------------------------------