[Mono-bugs] [Bug 65931][Cri] New - Dynamic assembly .GetTypes() length is wrong

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 14 Sep 2004 09:32:20 -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 martin.tapp@cae.com.

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

--- shadow/65931	2004-09-14 09:32:20.000000000 -0400
+++ shadow/65931.tmp.25122	2004-09-14 09:32:20.000000000 -0400
@@ -0,0 +1,42 @@
+Bug#: 65931
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 040 One week
+Priority: Critical
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: martin.tapp@cae.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Dynamic assembly .GetTypes() length is wrong
+
+Using Reflection:
+
+AssemblyName wAsmName = new AssemblyName();
+wAsmName.Name = "MyAssembly";
+
+string wPath = "/Some/Path";
+string wAssemblyDll = wPath + "/MyAssembly.dll";
+
+AssemblyBuilder wAsmBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly
+(wAsmName,AssemblyBuilderAccess.RunAndSave,wPath);
+
+ModuleBuilder wModuleBuilder = wAsmBuilder.DefineDynamicModule
+(wAssemblyDll,wAssemblyDll,false);
+
+
+After creating 251 types (public classes) with wModuleBuilder.DefineType
+(...),
+
+wAsmBuilder->GetTypes().Length returns 256 instead of 251 with mono, but 
+returns 251 with MS.NET.
+
+Thanks!
+
+Martin Tapp