[Mono-list] mono and .net differences in Type::GetType

kojoadams kojoadams@hotmail.com
Mon, 13 Jan 2003 12:57:56 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_006C_01C2BB03.6443DBE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

With .net Type.GetType seems to only load types that are in the corlib =
or in the running assembly, while mono's will load any type that is in =
the is in assembly in MONO_PATH.

eg

using System;
public class Driver{
    public static void Main(){
        //type will be null in .net System.Uri is in System.dll
        //   but won't on mono
        Type type =3D Type.GetType("System.Uri");
    }
}
------=_NextPart_000_006C_01C2BB03.6443DBE0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>With .net Type.GetType seems to only =
load types=20
that are in the corlib or in the running assembly, while&nbsp;mono's =
will load=20
any type that is in the is in assembly in MONO_PATH.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>eg</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>using System;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>public class Driver{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; public static void=20
Main(){</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //type=20
will be null in .net System.Uri is in System.dll</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp; =
but won't=20
on mono</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
Type type =3D=20
Type.GetType("System.Uri");</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV></BODY></HTML>

------=_NextPart_000_006C_01C2BB03.6443DBE0--