[asp.net] Fix for bug #669048. Fix up virtual precompiled app virtual paths with...
authorMarek Habersack <grendel@twistedcode.net>
Wed, 9 Feb 2011 20:59:00 +0000 (21:59 +0100)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 9 Feb 2011 20:59:00 +0000 (21:59 +0100)
mcs/class/System.Web/System.Web.Compilation/BuildManager.cs

index 0a1d6915290a49a01bd1a37256a4a353c9ecd93c..fc4db7fca68ce391d4ff348760079223157dfa1f 100644 (file)
@@ -221,6 +221,7 @@ namespace System.Web.Compilation
                        
                        string [] parts;
                        int skip = -1;
+                       string appVirtualRoot = VirtualPathUtility.AppendTrailingSlash (HttpRuntime.AppDomainAppVirtualPath);
                        foreach (string vpath in precompiled.Keys) {
                                parts = vpath.Split ('/');
                                for (int i = 0; i < parts.Length; i++) {
@@ -229,7 +230,7 @@ namespace System.Web.Compilation
                                        // 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);
+                                       string test_path = appVirtualRoot + String.Join ("/", parts, i, parts.Length - i);
                                        VirtualPath result = GetAbsoluteVirtualPath (test_path);
                                        if (result != null && File.Exists (result.PhysicalPath)) {
                                                skip = i - 1;