abryson wrote:
Hello,

I'm trying XSP2 on a Windows XP SP2 machine by executing xsp2.exe directly
(without mono.exe) and have hit upon a problem when specifying virtual
directories.


[...]

When I browse to http://localhost:8080/A or http://localhost:8080/B I get
this exception:

System.InvalidOperationException: Failed to map the path '/Greenstone.JPG'.

Server stack trace:
   at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath
virtualPat
h, Boolean permitNull)
   at System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath
virtualP
ath)
   at System.Web.Hosting.MapPathBasedVirtualPathProvider.FileExists(String
virtu
alPath)
   at Mono.WebServer.Paths.VirtualPathExists(IApplicationHost appHost,
String ve

[...]

So, any idea what is causing the exception?  Hope somebody can help.

This looks like a bug in MS.NET's ASP.NET.
VirtualPathProvider.FileExists is not supposed to throw exceptions.

Try applying the attached patch to xsp's sources.

Robert

Index: src/Mono.WebServer/Paths.cs
===================================================================
--- src/Mono.WebServer/Paths.cs (revision 140700)
+++ src/Mono.WebServer/Paths.cs (working copy)
@@ -69,9 +69,7 @@
 
                        int dot, slash;
                        int lastSlash = uri.Length;
-#if !NET_2_0
                        bool windows = (Path.DirectorySeparatorChar == '\\');
-#endif
                        string partial;
                                
                        for (dot = uri.LastIndexOf ('.'); dot > 0; dot = 
uri.LastIndexOf ('.', dot - 1)) {
@@ -83,17 +81,12 @@
                                partial = uri.Substring (0, slash);
                                lastSlash = slash;
 
-#if NET_2_0
-                               if (!VirtualPathExists (appHost, verb, partial))
-                                       continue;
-#else
                                if (windows)
                                        partial = partial.Replace ('/', '\\');
                                
                                string path = Path.Combine (basepath, 
(partial));
                                if (!File.Exists (path) && !VirtualPathExists 
(appHost, verb, partial))
                                        continue;
-#endif
                                
                                realUri = vpath + uri.Substring (0, slash);
                                pathInfo = uri.Substring (slash);
@@ -106,11 +99,6 @@
                        if (appHost.IsHttpHandler (verb, uri))
                                return true;
 
-#if NET_2_0
-                       VirtualPathProvider vpp = 
HostingEnvironment.VirtualPathProvider;
-                       if (vpp != null && vpp.FileExists ("/" + uri))
-                               return true;
-#endif
                        return false;
                }
        }
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to