[Mono-bugs] [Bug 471255] Type.GetType returns null for a given type only on Mono (works in .NET)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Feb 1 13:24:57 EST 2009


User gert.driesen at pandora.be added comment

Gert Driesen <gert.driesen at pandora.be> changed:

           What    |Removed                     |Added
                 CC|                            |gert.driesen at pandora.be

--- Comment #2 from Gert Driesen <gert.driesen at pandora.be>  2009-02-01 11:24:56 MST ---
Nope, the problem here is related to the fact that you're invoke Type.GetType
using reflection.

I can reproduce it using the following code snippet:

using System;
using System.Globalization;
using System.Reflection;

class Program
    static void Main ()
        Type t = typeof (Type);
        MethodInfo m = t.GetMethod ("GetType", 
            BindingFlags.Public | BindingFlags.Static,
            null, new Type [] { typeof (string) }, null);
        object r = m.Invoke (null, BindingFlags.Default, null,
            new object [] { "Program" }, CultureInfo.InvariantCulture);
        Console.WriteLine ("NULL? " + (r == null));

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list