Bug 323179 (MONO80490) - Assembly.LoadFile caching Same assembly from different paths
Summary: Assembly.LoadFile caching Same assembly from different paths
Status: RESOLVED DUPLICATE of bug 321202
Alias: MONO80490
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other All
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-10 15:49 UTC by José Faria
Modified: 2008-02-27 11:20 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:22:39 UTC


---- Reported by spigaz@gmail.com 2007-01-10 08:49:06 MST ----

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



---- Additional Comments From spigaz@gmail.com 2007-01-10 09:33:48 MST ----

I think this bug is related: 

https://bugzilla.novell.com/show_bug.cgi?id=MONO78464

Comment 1 Kornél Pál 2008-02-27 11:20:53 UTC

*** This bug has been marked as a duplicate of bug 321202 ***