|
|
@@ -169,7 +169,10 @@ namespace System.Web.Compilation {
|
|
|
for (int i = 0; i < parts.Length; i++) {
|
|
|
if (String.IsNullOrEmpty (parts [i]))
|
|
|
continue;
|
|
|
- string test_path = String.Join ("/", parts, i, parts.Length - i);
|
|
|
+ // The path must be rooted, otherwise PhysicalPath returned
|
|
|
+ // below will be relative to the current request path and
|
|
|
+ // File.Exists will return a false negative. See bug #546053
|
|
|
+ string test_path = "/" + String.Join ("/", parts, i, parts.Length - i);
|
|
|
VirtualPath result = GetAbsoluteVirtualPath (test_path);
|
|
|
if (result != null && File.Exists (result.PhysicalPath)) {
|
|
|
skip = i - 1;
|
|
|
@@ -177,6 +180,7 @@ namespace System.Web.Compilation {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
string app_vpath = HttpRuntime.AppDomainAppVirtualPath;
|
|
|
if (skip == -1 || (skip == 0 && app_vpath == "/"))
|
|
|
return;
|