[Mono-bugs] [Bug 78165][Nor] New - Assembly.LoadFrom loads the
wrong assembly
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sat Apr 22 14:38:17 EDT 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 colin at breame.net.
http://bugzilla.ximian.com/show_bug.cgi?id=78165
--- shadow/78165 2006-04-22 14:38:17.000000000 -0400
+++ shadow/78165.tmp.18848 2006-04-22 14:38:17.000000000 -0400
@@ -0,0 +1,59 @@
+Bug#: 78165
+Product: Mono: Runtime
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: colin at breame.net
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Assembly.LoadFrom loads the wrong assembly
+
+If the current directory contains:
+ test.exe
+ test.dll
+
+And we ask it load "test.dll" it insteads loads "test.exe". Compile and
+run the program below.
+
+It outputs:
+ hello from test.exe
+
+but should output (as LoadFrom's parameter is test.dll /not/ test.exe):
+ hello from test.dll
+
+Am I missing something?
+
+make.sh:
+mcs -out:test.exe test_exe.cs
+mcs -out:test.dll -target:library test_dll.cs
+
+test_exe.cs:
+sing System;
+using System.Reflection;
+
+public class Test {
+ public static void Main() {
+ Assembly assembly = Assembly.LoadFrom("test.dll");
+ object o = assembly.CreateInstance("Test");
+ Console.WriteLine(o.ToString());
+ }
+
+ public override string ToString() {
+ return "hello from test.exe";
+ }
+}
+
+test_dll.cs:
+public class Test {
+ public override string ToString() {
+ return "hello from test.dll";
+ }
+}
More information about the mono-bugs
mailing list