[Mono-bugs] [Bug 633037] New: System.Web.Mvc.ViewPage<dynamic> causes compiler exception when accessing Model methods or properties

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Aug 19 21:33:08 EDT 2010


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

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


           Summary: System.Web.Mvc.ViewPage<dynamic> causes compiler
                    exception when accessing Model methods or properties
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: denisv at post.skynet.lt
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8)
Gecko/20100722 Firefox/3.6.8

Versions:
Mono Git 42932bf97e7d985c273a264c34c30bd8c5d56b8c
XSP Git ab6ba373a90a89a3e75b0e17232a2dddd273dcc7
(pulled 2010-08-19)
OS: Debian squeeze

When an ASP.NET MVC page has a dynamic typed model

<%@ Page Title="" Language="C#"
MasterPageFile="~/Views/Shared/ViewMasterPage1.Master"
Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

and accesses the model

<%: Model.SomeMethod() %>

it causes System.NullReferenceException in Mono.CSharp.Invocation.EmitCall
(full exception stack trace is provided below)

Reproducible: Always

Steps to Reproduce:
1. Unzip attached zip file
2. xsp4 --port 8000
3. Point web browser to localhost:8000
Actual Results:  
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: : at Mono.CSharp.Invocation.EmitCall
(Mono.CSharp.EmitContext ec, Mono.CSharp.Expression instance_expr,
Mono.CSharp.MethodSpec method, Mono.CSharp.Arguments Arguments, Location loc,
Boolean dup_args, Boolean omit_args) [0x00000] in <filename unknown>:0
~/Views/Home/Index.aspx
Show Detailed Compiler Output:

dmcs /target:library /lib:"/tmp/bug/bin" /debug+ /optimize- /warn:4
/out:"/tmp/denis-temp-aspnet-0/d8918e95/App_Web_1763a62a.dll"
/r:"/opt/mono/lib/mono/4.0/mscorlib.dll"
/r:"/opt/mono/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll"
/r:"/opt/mono/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll"
/r:"/opt/mono/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll"
/r:"/opt/mono/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll"
/r:"/opt/mono/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll"
/r:"/opt/mono/lib/mono/gac/System.Web.Services/4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll"
/r:"/opt/mono/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll"
/r:"/opt/mono/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll"
/r:"/opt/mono/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll"
/r:"/opt/mono/lib/mono/gac/System.IdentityModel/4.0.0.0__b77a5c561934e089/System.IdentityModel.dll"
/r:"/opt/mono/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll"
/r:"/opt/mono/lib/mono/gac/System.Xaml/4.0.0.0__b77a5c561934e089/System.Xaml.dll"
/r:"/opt/mono/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll"
/r:"/opt/mono/lib/mono/gac/System.ServiceModel.Web/4.0.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll"
/r:"/opt/mono/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll"
/r:"/opt/mono/lib/mono/gac/System.Web.Extensions/4.0.0.0__31bf3856ad364e35/System.Web.Extensions.dll"
/r:"/opt/mono/lib/mono/gac/System.Data.DataSetExtensions/4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll"
/r:"/opt/mono/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll"
/r:"/opt/mono/lib/mono/gac/System.ComponentModel.DataAnnotations/4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll"
/r:"/opt/mono/lib/mono/gac/System.Web.DynamicData/4.0.0.0__31bf3856ad364e35/System.Web.DynamicData.dll"
/r:"/opt/mono/lib/mono/gac/System.Data.Linq/4.0.0.0__b77a5c561934e089/System.Data.Linq.dll"
/r:"/opt/mono/lib/mono/gac/System.Web.ApplicationServices/4.0.0.0__31bf3856ad364e35/System.Web.ApplicationServices.dll"
/r:"/opt/mono/lib/mono/gac/System.Web.Abstractions/4.0.0.0__31bf3856ad364e35/System.Web.Abstractions.dll"
/r:"/opt/mono/lib/mono/gac/System.Web.Routing/4.0.0.0__31bf3856ad364e35/System.Web.Routing.dll"
/r:"/opt/mono/lib/mono/gac/System.Web.Mvc/2.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll"
/r:"/tmp/bug/bin/MvcApplication1.dll"
/r:"/tmp/denis-temp-aspnet-0/d8918e95/App_global.asax_3469df5f.dll"
/r:"/tmp/denis-temp-aspnet-0/d8918e95/App_Web_ViewMasterPage1.Master.dbfc6dff.5b59d94a.dll"
 /nowarn:0169 /d:DEBUG  --
"/tmp/denis-temp-aspnet-0/d8918e95/App_Web_1763a62a_0.cs" 


Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression instance_expr, Mono.CSharp.MethodSpec method,
Mono.CSharp.Arguments Arguments, Location loc, Boolean dup_args, Boolean
omit_args) [0x00000] in :0 
  at Mono.CSharp.PropertyExpr.Emit (Mono.CSharp.EmitContext ec, Boolean
leave_copy) [0x00000] in :0 
  at Mono.CSharp.PropertyOrIndexerExpr`1[T].Emit (Mono.CSharp.EmitContext ec)
[0x00000] in :0 
  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000] in :0 
  at Mono.CSharp.Arguments.Emit (Mono.CSharp.EmitContext ec, Boolean dup_args,
Mono.CSharp.LocalTemporary this_arg) [0x00000] in :0 
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression instance_expr, Mono.CSharp.MethodSpec method,
Mono.CSharp.Arguments Arguments, Location loc, Boolean dup_args, Boolean
omit_args) [0x00000] in :0 
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression instance_expr, Mono.CSharp.MethodSpec method,
Mono.CSharp.Arguments Arguments, Location loc) [0x00000] in :0 
  at Mono.CSharp.DelegateInvocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
in :0 
  at Mono.CSharp.DynamicExpressionStatement.EmitCall (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression binder, Mono.CSharp.Arguments arguments, Boolean
isStatement) [0x00000] in :0 
  at Mono.CSharp.DynamicExpressionStatement.Emit (Mono.CSharp.EmitContext ec)
[0x00000] in :0 
  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000] in :0 
  at Mono.CSharp.Arguments.Emit (Mono.CSharp.EmitContext ec, Boolean dup_args,
Mono.CSharp.LocalTemporary this_arg) [0x00000] in :0 
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression instance_expr, Mono.CSharp.MethodSpec method,
Mono.CSharp.Arguments Arguments, Location loc, Boolean dup_args, Boolean
omit_args) [0x00000] in :0 
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression instance_expr, Mono.CSharp.MethodSpec method,
Mono.CSharp.Arguments Arguments, Location loc) [0x00000] in :0 
  at Mono.CSharp.DelegateInvocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
in :0 
  at Mono.CSharp.DynamicExpressionStatement.EmitCall (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression binder, Mono.CSharp.Arguments arguments, Boolean
isStatement) [0x00000] in :0 
  at Mono.CSharp.DynamicExpressionStatement.Emit (Mono.CSharp.EmitContext ec)
[0x00000] in :0 
  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000] in :0 
  at Mono.CSharp.Arguments.Emit (Mono.CSharp.EmitContext ec, Boolean dup_args,
Mono.CSharp.LocalTemporary this_arg) [0x00000] in :0 
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression instance_expr, Mono.CSharp.MethodSpec method,
Mono.CSharp.Arguments Arguments, Location loc, Boolean dup_args, Boolean
omit_args) [0x00000] in :0 
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression instance_expr, Mono.CSharp.MethodSpec method,
Mono.CSharp.Arguments Arguments, Location loc) [0x00000] in :0 
  at Mono.CSharp.DelegateInvocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
in :0 
  at Mono.CSharp.DynamicExpressionStatement.EmitCall (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression binder, Mono.CSharp.Arguments arguments, Boolean
isStatement) [0x00000] in :0 
  at Mono.CSharp.DynamicExpressionStatement.EmitStatement
(Mono.CSharp.EmitContext ec) [0x00000] in :0 
  at Mono.CSharp.DynamicInvocation.EmitStatement (Mono.CSharp.EmitContext ec)
[0x00000] in :0 
  at Mono.CSharp.StatementExpression.DoEmit (Mono.CSharp.EmitContext ec)
[0x00000] in :0 
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in :0 
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in :0 
  at Mono.CSharp.Block.Emit (Mono.CSharp.EmitContext ec) [0x00000] in :0 
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in
:0 
  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in
:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.DeclSpace parent) [0x00000] in :0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in :0 
  at Mono.CSharp.Method.Emit () [0x00000] in :0 


Expected Results:  
No error page

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


More information about the mono-bugs mailing list