[Mono-bugs] [Bug 74621][Nor] New - Reflection differences .NET / Mono: GetCustomAttributes dynamic assemblies

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 15 Apr 2005 12:59:13 -0400 (EDT)


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 dominic_ullmann@hispeed.ch.

http://bugzilla.ximian.com/show_bug.cgi?id=74621

--- shadow/74621	2005-04-15 12:59:13.000000000 -0400
+++ shadow/74621.tmp.16309	2005-04-15 12:59:13.000000000 -0400
@@ -0,0 +1,137 @@
+Bug#: 74621
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: XP
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dominic_ullmann@hispeed.ch               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Reflection differences .NET / Mono: GetCustomAttributes dynamic assemblies
+
+Description of Problem:
+The MS.NET implementation and the mono implementation differ in the 
+handling of GetCustomAttributes for types, which are contained in a 
+module generated at runtime with reflection.emit.
+
+Steps to reproduce the problem:
+1. Compile attached test case: mcs Test.cs
+2. mono Test.exe
+
+Actual Results:
+Some
+System.NotSupportedException: The invoked member is not supported in a 
+dynamic module:
+
+check with normal class
+after create, before save, using result type
+attr: TestAttribute
+
+
+after create, before save, using type got from dynamic assembly
+attr: TestAttribute
+
+
+after create, before save, using typeBuilder
+System.NotSupportedException: The invoked member is not supported in a 
+dynamic m
+odule.
+in <0x0001a> System.Reflection.Emit.TypeBuilder:GetCustomAttributes (bool)
+in <0x0002f> Test:PrintAttrs (System.Type)
+
+
+
+after create, get from modbuilder
+System.NotSupportedException: The invoked member is not supported in a 
+dynamic m
+odule.
+in <0x0001a> System.Reflection.Emit.TypeBuilder:GetCustomAttributes (bool)
+in <0x0002f> Test:PrintAttrs (System.Type)
+
+
+
+check with enum
+after create, before save, using result type
+System.NotSupportedException: The invoked member is not supported in a 
+dynamic m
+odule.
+in <0x0001a> System.Reflection.Emit.TypeBuilder:GetCustomAttributes (bool)
+in <0x0002f> Test:PrintAttrs (System.Type)
+
+
+
+after create, before save, using type got from dynamic assembly
+System.NotSupportedException: The invoked member is not supported in a 
+dynamic m
+odule.
+in <0x0001a> System.Reflection.Emit.TypeBuilder:GetCustomAttributes (bool)
+in <0x0002f> Test:PrintAttrs (System.Type)
+
+
+
+after create, before save, using typeBuilder
+System.NotSupportedException: The invoked member is not supported in a 
+dynamic m
+odule.
+in <0x0001a> System.Reflection.Emit.TypeBuilder:GetCustomAttributes (bool)
+in <0x0002f> Test:PrintAttrs (System.Type)
+
+
+
+after create, before save, get from modbuilder
+System.NotSupportedException: The invoked member is not supported in a 
+dynamic m
+odule.
+in <0x0001a> System.Reflection.Emit.TypeBuilder:GetCustomAttributes (bool)
+in <0x0002f> Test:PrintAttrs (System.Type)
+
+
+
+
+
+Expected Results: (MS.NET implementation)
+
+check with normal class
+after create, before save, using result type
+attr: TestAttribute
+
+
+after create, before save, using type got from dynamic assembly
+attr: TestAttribute
+
+
+after create, before save, using typeBuilder
+attr: TestAttribute
+
+
+after create, get from modbuilder
+attr: TestAttribute
+
+
+check with enum
+after create, before save, using result type
+attr: TestAttribute
+
+
+after create, before save, using type got from dynamic assembly
+attr: TestAttribute
+
+
+after create, before save, using typeBuilder
+attr: TestAttribute
+
+
+after create, before save, get from modbuilder
+attr: TestAttribute
+
+How often does this happen? 
+always
+
+Additional Information: