[Mono-bugs] [Bug 77513][Wis] New - PropertyInfo.GetValue fails on
some types
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Feb 9 12:55:57 EST 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by eric at extremeboredom.net.
http://bugzilla.ximian.com/show_bug.cgi?id=77513
--- shadow/77513 2006-02-09 12:55:57.000000000 -0500
+++ shadow/77513.tmp.886 2006-02-09 12:55:57.000000000 -0500
@@ -0,0 +1,74 @@
+Bug#: 77513
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: eric at extremeboredom.net
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: PropertyInfo.GetValue fails on some types
+
+The following code throws an exception on mono, but works on MS.NET 2.0:
+
+-- snip --
+
+using System;
+using System.Reflection;
+
+public class test
+{
+ public static void Main ()
+ {
+ Assembly asm = Assembly.Load ("System, Version=2.0.0.0,
+Culture=neutral, PublicKeyToken=b77a5c561934e089");
+ Type blah = asm.GetType
+("System.CodeDom.Compiler.CodeDomProvider");
+
+ foreach (Attribute a in blah.GetCustomAttributes (false)) {
+ foreach (PropertyInfo f in
+a.GetType().GetProperties (BindingFlags.Public|BindingFlags.Instance)) {
+ Console.WriteLine (f.GetValue (a, null));
+ }
+ }
+ }
+}
+
+-- snip --
+
+Unhandled Exception: System.Reflection.TargetInvocationException: Exception
+has been thrown by the target of an invocation. --->
+System.ArgumentException: Fail ed to create ToolboxItem of type: --->
+System.TypeLoadException: Could not load type ''.
+in <0x00000> <unknown method>
+in (wrapper managed-to-native) System.Type:internal_from_name
+(string,bool,bool)
+in <0x00021> System.Type:GetType (System.String typeName, Boolean throwOnError)
+in <0x00040> System.ComponentModel.ToolboxItemAttribute:get_ToolboxItemType
+()--- End of inner exception stack trace ---
+
+in <0x000ab> System.ComponentModel.ToolboxItemAttribute:get_ToolboxItemType ()
+in <0x00000> <unknown method>
+in (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
+(object,object[])
+in <0x0008d> System.Reflection.MonoMethod:Invoke (System.Object obj,
+BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[]
+parameters, Syst em.Globalization.CultureInfo culture)--- End of inner
+exception stack trace ---
+
+in <0x0010e> System.Reflection.MonoMethod:Invoke (System.Object obj,
+BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[]
+parameters, Syst em.Globalization.CultureInfo culture)
+in <0x00067> System.Reflection.MonoProperty:GetValue (System.Object obj,
+BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[]
+index, Syste m.Globalization.CultureInfo culture)
+in <0x0001a> System.Reflection.PropertyInfo:GetValue (System.Object obj,
+System.Object[] index)
+in <0x000fa> test:Main ()
More information about the mono-bugs
mailing list