[Mono-bugs] [Bug 29900][Wis] New - runtime doesn't reference assemblies correctly

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
4 Sep 2002 21:47:17 -0000


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 piersh@friskit.com.

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

--- shadow/29900	Wed Sep  4 17:47:17 2002
+++ shadow/29900.tmp.18302	Wed Sep  4 17:47:17 2002
@@ -0,0 +1,52 @@
+Bug#: 29900
+Product: Mono/Runtime
+Version: unspecified
+OS: Debian Woody
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: piersh@friskit.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: runtime doesn't reference assemblies correctly
+
+to repro:
+- create two assemblies with the same name (eg, 'a.dll') containing 
+different types and place them in different directories 
+(eg, "./1/a.dll", "./2/a.dll").
+- now try to load and reflect the types in both assemblies.
+- the second assembly will never be loaded, it will just return a 
+reference to the first (see mono/mono/metadata/assembly.c, line 
+~393, "  /* avoid loading the same assembly twixe for now... */")
+
+here's the source for the test, I'll try to attach the whole test case:
+
+using System;
+using System.Reflection;
+using foo;
+
+namespace test
+{
+    class Test
+    {
+        public static void Main (string [] rgArgs)
+        {
+            Assembly asm1 = Assembly.LoadFrom ("1/a.dll");
+            Assembly asm2 = Assembly.LoadFrom ("2/a.dll");
+
+            Console.WriteLine ("asm1:");
+            foreach (Type t in asm1.GetTypes ())
+                Console.WriteLine (t.Name);
+
+            Console.WriteLine ("asm2:");
+            foreach (Type t in asm2.GetTypes ())
+                Console.WriteLine (t.Name);
+        }
+    }
+}