Bugzilla – Bug 377692
Assembly.CodeBase is broken when assemblies are shadow-copied (at least in an asp.net environment)
Last modified: 2008-10-07 06:38:51 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.
*** This bug has been marked as a duplicate of bug 323606 ***