Bug 377692 - Assembly.CodeBase is broken when assemblies are shadow-copied (at least in an asp.net environment)
Summary: Assembly.CodeBase is broken when assemblies are shadow-copied (at least in an...
Status: RESOLVED DUPLICATE of bug 323606
Alias: None
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.9
Hardware: PowerPC Mac OS X 10.4
: P5 - None : Normal
Target Milestone: ---
Assignee: Marek Habersack
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-07 18:19 UTC by Johannes Roith
Modified: 2008-10-07 06:38 UTC (History)
0 users

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 Johannes Roith 2008-04-07 18:19:28 UTC
When assemblies are shadow-copied (as is the case in ASP.NET) Assembly.CodeBase should return the original path before the copy was made. Assembly.Location should return the new path. (In ASP.NET that means, that Assembly.CodePath should return the path of the assembly in the /Bin directory.)

In Mono both properties point to the copy.

To reproduce this, compile an assembly containing this:

using System;
using System.Reflection;

class Test {
	public Test () {
		Console.WriteLine ("codebase:" + Assembly.GetExecutingAssembly ().CodeBase);
		Console.Writeline ("location:" + Assembly.GetExecutingAssembly ().Location);
	}
}

and put it in the /Bin directory. Add <% new Test (); %> to a page and take a look at the console output.
Comment 1 Gonzalo Paniagua Javier 2008-10-07 06:38:51 UTC

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