[Mono-bugs] [Bug 653192] New: Using a relative path for the MasterPageFile throws an exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Nov 12 03:24:41 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=653192

https://bugzilla.novell.com/show_bug.cgi?id=653192#c0


           Summary: Using a relative path for the MasterPageFile throws an
                    exception
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: dredd422 at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=399853)
 --> (http://bugzilla.novell.com/attachment.cgi?id=399853)
ASP.NET MVC with relative MasterPage path

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7
(KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7

If you use a relative path for the MasterPageFile attribute in a ViewPage using
ASP.NET MVC, an exception is thrown.  This is because the path is supposed to
be relative to the path of the ViewPage file, but Mono makes it relative to the
Web Request path.

Reproducible: Always

Steps to Reproduce:
1. Create an ASP.NET MVC Application
2. Create a ViewPage and a MasterPage
3. Set the MasterPageFile attribute using a relative path to the ViewPage file
Actual Results:  
System.Web.HttpException: Cannot use a leading .. to exit above the top
directory.
  at System.Web.VirtualPathUtility.Normalize (System.String path) [0x0017f] in
/usr/src/packages/BUILD/mono-2.8.1/mcs/class/System.Web/System.Web/VirtualPathUtility.cs:400 
  at System.Web.VirtualPathUtility.Combine (System.String basePath,
System.String relativePath) [0x00066] in
/usr/src/packages/BUILD/mono-2.8.1/mcs/class/System.Web/System.Web/VirtualPathUtility.cs:87 
.....

Expected Results:  
Page successfully displayed.

Attached is the ASP.NET MVC 2 template site created by VS 2010 altered to use
relative path MasterPageFile attributes.  It runs fine on MS .NET, but throws
an exception on Mono.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list