[Mono-list] Reflection Problem

Piers Haken piersh@friskit.com
Thu, 20 Mar 2003 11:08:09 -0800


The best book I have seen on the .NET runtime is "Applied Microsoft .NET
Framework Programming" by Jeffrey Richter.

http://www.amazon.com/exec/obidos/ASIN/0735614229/qid=3D1048186879/sr=3D2=
-1/
ref=3Dsr_2_1/002-7268009-8165665

Its focus is more on the workings of the runtime than the C# language.

Piers.

> -----Original Message-----
> From: Carlos Alberto Cortez [mailto:is118149@mail.udlap.mx]=20
> Sent: Thursday, March 20, 2003 6:42 AM
> To: Mono List
> Subject: Re: [Mono-list] Reflection Problem
>=20
>=20
>=20
> Hello!
>=20
> Oh ok, thanks. It happens that I was learning reflection from=20
> a the C# language from O'Reilly ... so, could you please=20
> recomend me a good book? I have the thinking in c# too, but=20
> the reflection topic comes all in java ...
>=20
> Regards,
> Carlos.
>=20
> El jue, 20-03-2003 a las 04:21, Paolo Molaro escribi=F3:
> > On 03/20/03 Carlos Alberto Cortez wrote:
> > > Unhandled Exception: System.MissingMethodException: Default=20
> > > constructor not found in <0x0019b> 00=20
> > > System.Activator:CreateInstance (System.Type,bool) in=20
> <0x00031> 00=20
> > > .ReflectionTest:Main ()
> > >=20
> > > The code I'm writing is the next:
> > >=20
> > > using System;
> > > using System.Reflection;
> > >=20
> > >  public class ReflectionTest {
> > >=20
> > >         public static void Main () {
> > >=20
> > >                 Type theMathType =3D Type.GetType("System.Math");
> > >                 Object theObj =3D=20
> > > Activator.CreateInstance(theMathType);
> > >=20
> > > 	}
> > >  }
> >=20
> > Your code is buggy: you can't create an instance of=20
> System.Math, since=20
> > it has no constructors accessible to you. You'll get the=20
> same bug if=20
> > you run your code on the MS runtime.
> >=20
> > lupus
> >=20
> > --
> > -----------------------------------------------------------------
> > lupus@debian.org                                     debian/rules
> > lupus@ximian.com                             Monkeys do it better
> --=20
> --------------------------------------------------
> /* The definition of myself */
> using Cortez;
> using GeniusIntelligence;
>=20
> public class Carlos : Human, IGenius, ILinuxUser {
>=20
> 	static void Main () {
> 		Me.Born();
> 	}
>=20
> }
>=20
> --------------------------------------------------
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com=20
> http://lists.ximian.com/mailman/listinfo/mono-list
>=20