Author: mhabersack
Date: 2008-02-05 08:03:07 -0500 (Tue, 05 Feb 2008)
New Revision: 94879
Modified:
branches/mono-1-9/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
branches/mono-1-9/mcs/class/System.Web/System.Web.Compilation/ChangeLog
Log:
Backport of r94878
Modified:
branches/mono-1-9/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
===================================================================
---
branches/mono-1-9/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
2008-02-05 13:02:41 UTC (rev 94878)
+++
branches/mono-1-9/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
2008-02-05 13:03:07 UTC (rev 94879)
@@ -373,9 +373,15 @@
{
string vp;
- if (!VirtualPathUtility.IsRooted (virtualPath))
- vp = "~/" + virtualPath;
- else
+ if (!VirtualPathUtility.IsRooted (virtualPath)) {
+ HttpContext ctx = HttpContext.Current;
+ HttpRequest req = ctx != null ? ctx.Request :
null;
+
+ if (req != null)
+ vp = VirtualPathUtility.GetDirectory
(req.FilePath) + virtualPath;
+ else
+ throw new HttpException ("No context,
cannot map paths.");
+ } else
vp = virtualPath;
if (VirtualPathUtility.IsAppRelative (vp))
@@ -414,8 +420,8 @@
public static Type GetCompiledType (string virtualPath)
{
string vp = GetAbsoluteVirtualPath (virtualPath);
-
BuildCacheItem ret = GetCachedItem (vp);
+
if (ret != null)
return ret.type;
Modified:
branches/mono-1-9/mcs/class/System.Web/System.Web.Compilation/ChangeLog
===================================================================
--- branches/mono-1-9/mcs/class/System.Web/System.Web.Compilation/ChangeLog
2008-02-05 13:02:41 UTC (rev 94878)
+++ branches/mono-1-9/mcs/class/System.Web/System.Web.Compilation/ChangeLog
2008-02-05 13:03:07 UTC (rev 94879)
@@ -1,5 +1,9 @@
2008-02-05 Marek Habersack <[EMAIL PROTECTED]>
+ * BuildManager.cs: GetAbsoluteVirtualPath correctly converts
+ non-rooted relative paths to absolute ones now. Fixes bug
+ #357504.
+
* GenericBuildProvider.cs: introduced a new abstract method,
GetReferencedAssemblies, which is called on descendant builders to
get a list of assemblies referenced by the parsed file. Fixes bug
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches