[Mono-bugs] [Bug 80490][Nor] New - Assembly.LoadFile caching Same assembly from different paths

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jan 10 08:49:07 EST 2007


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 spigaz at gmail.com.

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

--- shadow/80490	2007-01-10 08:49:07.000000000 -0500
+++ shadow/80490.tmp.27703	2007-01-10 08:49:07.000000000 -0500
@@ -0,0 +1,67 @@
+Bug#: 80490
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: spigaz at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Assembly.LoadFile caching Same assembly from different paths
+
+Description of Problem:
+The Assembly.LoadFile method is behaving as Assembly.LoadFrom, and it can't.
+
+As stated on the msdn2 and tested on .net 2.0, the Assembly.LoadFile method
+doesn't cache the loading of assemblies with the same AssemblyName from
+diferent paths.
+
+Steps to reproduce the problem:
+1. Create a File Fake.cs in a Directory A, and compile it to Fake.dll:
+class FakeA{}
+
+2. Create a File Fake.cs in a Directory B, and compile it to Fake.dll:
+class FakeB{}
+
+3. In the outer directory create a file AssemblyLoad.cs and compile it to
+AssemblyLoad.exe:
+using System.IO;
+using System.Reflection;
+
+public class AssemblyLoad
+{
+	public static void Main(string[] args)
+	{
+	
+System.Console.WriteLine(Assembly.LoadFile(Path.Combine(Directory.GetCurrentDirectory(),
+Path.Combine("A", "Fake.dll"))).Location);
+	
+System.Console.WriteLine(Assembly.LoadFile(Path.Combine(Directory.GetCurrentDirectory(),
+Path.Combine("B", "Fake.dll"))).Location);
+	}
+}
+
+4. Execute AssemblyLoad.exe
+
+Actual Results:
+/AssemblyLoad/A/Fake.dll
+/AssemblyLoad/A/Fake.dll
+
+Expected Results:
+/AssemblyLoad/A/Fake.dll
+/AssemblyLoad/B/Fake.dll
+
+How often does this happen? 
+Always.
+
+Additional Information:
+Tested on .net 2.0:
+C:\AssemblyLoad\A\Fake.dll
+C:\AssemblyLoad\B\Fake.dll


More information about the mono-bugs mailing list