[Mono-bugs] [Bug 53180][Wis] New - assembly name clash prevents Assembly.GetType() from working

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 21 Jan 2004 15:03:52 -0500 (EST)


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 malekith@pld-linux.org.

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

--- shadow/53180	2004-01-21 15:03:52.000000000 -0500
+++ shadow/53180.tmp.6211	2004-01-21 15:03:52.000000000 -0500
@@ -0,0 +1,66 @@
+Bug#: 53180
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: malekith@pld-linux.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: assembly name clash prevents Assembly.GetType() from working
+
+Description of Problem:
+
+Mono fails to properly load types using GetType() method called on
+assembly, when assembly has the same name (and version?) as calling exacutable.
+
+First, we will compile two files, so they have the same name (foo):
+
+[malekith@roke /shm]$ mcs /target:library /out:foo.dll foo2.cs
+Compilation succeeded
+[malekith@roke /shm]$ mcs /target:exe /out:foo.exe foo1.cs
+Compilation succeeded
+[malekith@roke /shm]$ ./foo.exe
+failed T load
+[malekith@roke /shm]$ 
+
+Now we recompile the library under different name, and rename the file:
+
+[malekith@roke /shm]$ mcs /target:library /out:foo_diff_name.dll foo2.cs
+Compilation succeeded
+[malekith@roke /shm]$ mv foo_diff_name.dll foo.dll
+[malekith@roke /shm]$ ./foo.exe
+[malekith@roke /shm]$
+
+And now everything is ok.
+
+foo1.cs:
+#v+
+using System.Reflection;
+
+class M {
+public static void Main ()
+{
+Assembly a = Assembly.LoadFrom ("foo.dll");
+if (a.GetType ("T") == null) System.Console.WriteLine ("failed T load");
+}
+}
+#v-
+
+foo2.cs:
+#v+
+class T { }
+#v-
+
+How often does this happen? 
+always
+
+Additional Information:
+mono 0.29.99.20040118