[Mono-bugs] [Bug 457069] New: Page. LoadControl fails if path case does not match class namespace

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Dec 6 16:52:34 EST 2008


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


           Summary: Page.LoadControl fails if path case does not match class
                    namespace
           Product: Mono: Class Libraries
           Version: 2.0.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: seanhig at geminibay.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Description of Problem:

The 2.x series was always failing on my Page.LoadControl().  I was getting a
compilation error:
System.Web.Compilation.CompilationException: Exception of type
'System.Web.Compilation.CompilationException' was thrown.
  at System.Web.Compilation.AssemblyBuilder.BuildAssembly
(System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters
options) [0x00000] 
  at System.Web.Compilation.AssemblyBuilder.BuildAssembly
(System.Web.VirtualPath virtualPath) [0x00000] 
  at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath
virtualPath) [0x00000] 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String
virtualPath) [0x00000] 
  at System.Web.UI.TemplateControl.GetTypeFromControlPath (System.String
virtualPath) [0x00000] 
  at System.Web.UI.TemplateControl.LoadControl (System.String virtualPath)
[0x00000] 

Steps to reproduce the problem:
1. use Page.LoadControl to load a control where the relative path to the
control represents a segement of the namespace (ie.
<namespace>.Controls.MyControl.ascx, where MyControl.ascx is in a /controls
folder in the web)

2.  If you pass the control path to LoadControl using a different case then the
namespace segement (ie. "/controls/MyControl.ascx") , you will throw the above
exception, if the string you pass matches the namespace case (i.e.
"/Controls/MyControl.ascx"), it will work fine. 

It matters not what the case of actual folder is on the file system.

Additional Information:

I would never have thought of this if not for the fact that another LoadControl
usage was having pathing issues, and during resolution of that bug, I was
getting vpath errors.  Since this was a compilation error, and I knew the path
was correct, the bizarre thought that the compilation was relying on folder
pathing to complete the relative namespace of the control came to me.  I tested
this wacked hypothesis by changing the folder case passed to the LoadControl to
match the namespace, and suddenly, it started working.

Methinks someone is using the wrong string somewhere down there in LoadControl.

As usual, this is/was never a problem with the MS runtime.


-- 
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