[Mono-bugs] [Bug 475919] New: UserControl inside directories names not starting with alpha-char

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 13 18:26:28 EST 2009


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


           Summary: UserControl inside directories names not starting with
                    alpha-char
    Classification: Mono
           Product: Mono: Runtime
           Version: unspecified
          Platform: i386
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: marco at montevarchi.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; it; rv:1.9.0.6)
Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)

Hi, really sorry if this category don't fits the problem, i'm completely NEW to
mono on a linux system, with Debian lenny distro. But I think this will be true
to any platforms.

When you put a User control inside a folder with a non alpha char (for example
"!" symbol) this forces mono compiler to produce somthing like:

    public class !uc_mycontrol_ascx : global::XXXXXXXX.XXXXXXXXXX.UC.mycontrol
{

which is not really a nice idea...
I've just "moved" my production site (which works on a microsoft .net
implementation over a windows 2003 server since 5 years). I was "just curious
to see" and so i configured debian, apache2, mono etc..

Folder names on a windows platform allows you to include a "!" symbol. I
originally choosen that just because it puts the folders (my "special folders")
on top of any browser, just a old trick.

so this is the error that comes out:

Compilation Error

Description: Error compiling a resource required to service this request.
Review your source file and modify it to fix this error.

Compiler Error Message:
/tmp/www-data-temp-aspnet-0/67727ab7/App_Web_6061c649_1.cs(82,18) : error
CS1518: Expected `class', `delegate', `enum', `interface', or `struct'

Source Error:

Line 80:     
Line 81:     
Line 82:     public class !uc_mycontrol_ascx :
global::XXXXXXXX.XXXXXXXX.UC.mycontrol {
Line 83:         
Line 84:         private static bool __initialized = false;


Source File: /tmp/www-data-temp-aspnet-0/67727ab7/App_Web_6061c649_1.cs  Line:
82


I suppose it's generated from folder_name+_+usercontrol_name_ascx etc etc
etc...
I think (but i can be on the wrong side) that the compiler should convert it to
something like:

_uc_mycontrol_ascx (etc. etc.)

This is also the way Visual Studio handles file generations when you create a
file containing such things. (i would also add numbers etc..).

I can surely adapt the while code/project to fit mono rules, i'm just
experimenting in the hope to move my windows based environment to a linux one,
and i've all the time to get this goal, so it's not critical to me, but i
*strongly think* that all your work, a great work, would move to a (hypotetic?)
1:1 portability scheme.

My two cents.




Reproducible: Always

Steps to Reproduce:
1. Create a folder, call it "!uc" (without hypens)
2. put on it a user control, eg. mycontrol.ascx and some code into mycontrol.cs
3. create a page to the root, and at some point try to call/reference it with
something like: mycontroltype
x=(mycontroltype)LoadControl("~/!uc/mycontrol.ascx");
4. try to browse, step 3 isn't really necessary, as it happens at site-build
time.
Actual Results:  
Please note that i've cut off my personal namespaces, replaced with XXXX,
sorry, but don't think i've set a wrong namespace, I work on .net since 2001,
I'm not newbie :-)

Server Error in '/' Application
Compilation Error

Description: Error compiling a resource required to service this request.
Review your source file and modify it to fix this error.

Compiler Error Message:
/tmp/www-data-temp-aspnet-0/67727ab7/App_Web_6061c649_1.cs(82,18) : error
CS1518: Expected `class', `delegate', `enum', `interface', or `struct'

Source Error:

Line 80:     
Line 81:     
Line 82:     public class !uc_mycontrol_ascx :
global::XXXXXXXX.XXXXXX.UC.mycontrol {
Line 83:         
Line 84:         private static bool __initialized = false;


Source File: /tmp/www-data-temp-aspnet-0/67727ab7/App_Web_6061c649_1.cs  Line:
82

Show Complete Compilation Source:

[...]

Expected Results:  
working? :-)

I was expecting to get something more to work, or at least to fail moreover at
some places... not at automatic compilation for a legal path.

This is what it generated into /tmp/...../App_Web_XXXXX.cs


[...CUT...]

namespace ASP {
    using System;
    using System.Collections;
    using System.Collections.Specialized;
    using System.Configuration;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Web;
    using System.Web.Caching;
    using System.Web.SessionState;
    using System.Web.Security;
    using System.Web.Profile;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;


    public class !uc_mycontrol_ascx : global::XXXXXX.XXXXXX.UC.mycontrol {

        private static bool __initialized = false;

        private static int __autoHandlers;

        public !uc_mycontrol_ascx() {
            ((global::System.Web.UI.UserControl)(this)).AppRelativeVirtualPath
= "~/!uc/mycontrol.ascx";
            if ((global::ASP.!uc_mycontrol_ascx.__initialized == false)) {
                global::ASP.!uc_mycontrol_ascx.__initialized = true;
            }
        }

[...CUT...]


I think this is the relevant part.

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