[Mono-bugs] [Bug 78135][Wis] New - asp.net 2.0 page creates invalid code

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Apr 18 13:44:30 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ck at carlo-kok.com.

http://bugzilla.ximian.com/show_bug.cgi?id=78135

--- shadow/78135	2006-04-18 13:44:30.000000000 -0400
+++ shadow/78135.tmp.12056	2006-04-18 13:44:30.000000000 -0400
@@ -0,0 +1,122 @@
+Bug#: 78135
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: gonzalo at ximian.com                            
+ReportedBy: ck at carlo-kok.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: asp.net 2.0 page creates invalid code
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Using a 2.0 page with a codefile with a class name that doesn't match the
+filename and includes a namespace will create invalid code:
+
+Steps to reproduce the problem:
+1. create an index.aspx like:
+<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="index.aspx.cs"
+Inherits="ASP._Default" %>
+
+2. and the index.aspx.cs:
+namespace ASP {
+  public partial class _Default {
+  }
+}
+
+3. run under xsp2
+
+Actual Results:
+Line 1: //
+------------------------------------------------------------------------------
+Line 2: //  <autogenerated>
+Line 3: //      This code was generated by a tool.
+Line 4: //      Mono Runtime Version: 2.0.50727.42
+Line 5: //
+Line 6: //      Changes to this file may cause incorrect behavior and
+will be lost if
+Line 7: //      the code is regenerated.
+Line 8: //  </autogenerated>
+Line 9: //
+------------------------------------------------------------------------------
+Line 10:
+Line 11: using System;
+Line 12: using System.Collections;
+Line 13: using System.Collections.Specialized;
+Line 14: using System.Configuration;
+Line 15: using System.Text;
+Line 16: using System.Text.RegularExpressions;
+Line 17: using System.Web;
+Line 18: using System.Web.Caching;
+Line 19: using System.Web.Security;
+Line 20: using System.Web.SessionState;
+Line 21: using System.Web.UI;
+Line 22: using System.Web.UI.WebControls;
+Line 23: using System.Web.UI.HtmlControls;
+Line 24:
+Line 25: public partial class ASP._Default :
+System.Web.SessionState.IRequiresSessionState {
+Line 26:
+Line 27:     private static bool __initialized = false;
+Line 28:
+Line 29:     private static int __autoHandlers;
+Line 30:
+Line 31:     public ASP._Default() {
+Line 32:         if ((ASP._Default.__initialized == false)) {
+Line 33:             ASP._Default.__initialized = true;
+Line 34:         }
+Line 35:     }
+Line 36:
+Line 37:     protected override int AutoHandlers {
+Line 38:         get {
+Line 39:             return ASP._Default.__autoHandlers;
+Line 40:         }
+Line 41:         set {
+Line 42:             ASP._Default.__autoHandlers = value;
+Line 43:         }
+Line 44:     }
+Line 45:
+Line 46:     protected System.Web.HttpApplication ApplicationInstance {
+Line 47:         get {
+Line 48:             return
+((System.Web.HttpApplication)(this.Context.ApplicationInstance));
+Line 49:         }
+Line 50:     }
+Line 51:
+Line 52:     public override string TemplateSourceDirectory {
+Line 53:         get {
+Line 54:             return "/";
+Line 55:         }
+Line 56:     }
+Line 57:
+Line 58:     private void __BuildControlTree(index_aspx __ctrl) {
+Line 59:     }
+Line 60:
+Line 61:     protected override void FrameworkInitialize() {
+Line 62:         base.FrameworkInitialize();
+Line 63:         this.TraceModeValue = System.Web.TraceMode.SortByTime;
+Line 64:         this.Request.ValidateInput();
+Line 65:         this.__BuildControlTree(this);
+Line 66:     }
+Line 67:
+Line 68:     public override int GetTypeHashCode() {
+Line 69:         return 201806986;
+Line 70:     }
+Line 71: }
+
+
+Note that there's no namespace present (and therefor it doesn't
+compile), also note that __BuildControlTree uses the class index_aspx
+which doesn't exist. In this case it's called ASP.Default.
+
+How often does this happen? 
+Every time.


More information about the mono-bugs mailing list