[Mono-dev] ASP.NET MVC 3 with Razor on Mono 2.10.1 ?

vlad vg at quest.com.mx
Wed May 25 14:18:08 EDT 2011


Hello everybody. I'm just trying Mono to run MVC3 projects. The idea of
running it all under linux is exiting!

I got something I believe might be a bug (maybe just my ignorance): I'm
getting the error "System.FormatException: Index (zero based) must be
greater than or equal to zero and less than the size of the argument list."
on  a sample ASP.NET MVC3 Web Application (an Internet Application with the
Razor View engine as created with the VS2010 wizard) running under Mono. The
same page runs flawless under Windows. The page is the Registration form of
the mentioned sample project (the one located at /Account/Register on the
project).

My setup is as follows:

CentOS 5.6 x86
Apache 2.2.3
Mono 2.10.2 with rpms from
http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/1.6.16/rhel5/i386/
SELinux in permissive mode (sudo /usr/sbin/setenforce 0)

My project has on it's bin dir:
Mvc3MonoTest.dll        System.Web.Razor.xml
Mvc3MonoTest.pdb        System.Web.WebPages.Deployment.dll
System.Web.Helpers.dll  System.Web.WebPages.dll
System.Web.Mvc.dll      System.Web.WebPages.Razor.dll
System.Web.Mvc.xml      System.Web.WebPages.xml
System.Web.Razor.dll

Does anybody think it might be a bug? Does it runs fine for someone under a
different distro or self compiled Mono?

The full text of the error page is:

Server Error in '/Mvc3MonoTest' Application
Index (zero based) must be greater than or equal to zero and less than the
size of the argument list.

Description: HTTP 500. Error processing request.

Stack Trace:

System.FormatException: Index (zero based) must be greater than or equal to
zero and less than the size of the argument list.
  at System.String.FormatHelper (System.Text.StringBuilder result,
IFormatProvider provider, System.String format, System.Object[] args)
[0x00256] in
/usr/src/redhat/BUILD/mono-2.10.2/mcs/class/corlib/System/String.cs:1925 
  at System.String.Format (IFormatProvider provider, System.String format,
System.Object[] args) [0x00000] in
/usr/src/redhat/BUILD/mono-2.10.2/mcs/class/corlib/System/String.cs:1820 
  at System.String.Format (System.String format, System.Object arg0,
System.Object arg1) [0x00000] in
/usr/src/redhat/BUILD/mono-2.10.2/mcs/class/corlib/System/String.cs:1805 
  at
System.ComponentModel.DataAnnotations.StringLengthAttribute.FormatErrorMessage
(System.String name) [0x00000] in
/usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/StringLengthAttribute.cs:60 
  at System.Web.Mvc.DataAnnotationsModelValidator.get_ErrorMessage ()
[0x00000] in <filename unknown>:0 
  at System.Web.Mvc.StringLengthAttributeAdapter.GetClientValidationRules ()
[0x00000] in <filename unknown>:0 
  at System.Web.Mvc.HtmlHelper.<.ctor>b__1 (System.Web.Mvc.ModelValidator v)
[0x00000] in <filename unknown>:0 
  at
System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator29`2[System.Web.Mvc.ModelValidator,System.Web.Mvc.ModelClientValidationRule].MoveNext
() [0x00059] in
/usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.Core/System.Linq/Enumerable.cs:2262 
  at System.Web.Mvc.HtmlHelper.GetUnobtrusiveValidationAttributes
(System.String name, System.Web.Mvc.ModelMetadata metadata) [0x00000] in
<filename unknown>:0 
  at System.Web.Mvc.Html.InputExtensions.InputHelper
(System.Web.Mvc.HtmlHelper htmlHelper, InputType inputType,
System.Web.Mvc.ModelMetadata metadata, System.String name, System.Object
value, Boolean useViewData, Boolean isChecked, Boolean setId, Boolean
isExplicitValue, IDictionary`2 htmlAttributes) [0x00000] in <filename
unknown>:0 
  at System.Web.Mvc.Html.InputExtensions.PasswordHelper
(System.Web.Mvc.HtmlHelper htmlHelper, System.Web.Mvc.ModelMetadata
metadata, System.String name, System.Object value, IDictionary`2
htmlAttributes) [0x00000] in <filename unknown>:0 
  at System.Web.Mvc.Html.InputExtensions.PasswordFor[RegisterModel,String]
(System.Web.Mvc.HtmlHelper`1 htmlHelper,
System.Linq.Expressions.Expression`1 expression, IDictionary`2
htmlAttributes) [0x00000] in <filename unknown>:0 
  at System.Web.Mvc.Html.InputExtensions.PasswordFor[RegisterModel,String]
(System.Web.Mvc.HtmlHelper`1 htmlHelper,
System.Linq.Expressions.Expression`1 expression) [0x00000] in <filename
unknown>:0 
  at ASP._Page_Views_Account_Register_cshtml.Execute () [0x003d0] in
/var/www/Mvc3MonoTest/Views/Account/Register.cshtml:44 
  at System.Web.WebPages.WebPageBase.ExecutePageHierarchy () [0x00000] in
<filename unknown>:0 
  at System.Web.Mvc.WebViewPage.ExecutePageHierarchy () [0x00000] in
<filename unknown>:0 
  at System.Web.WebPages.StartPage.RunPage () [0x00000] in <filename
unknown>:0 
  at System.Web.WebPages.StartPage.ExecutePageHierarchy () [0x00000] in
<filename unknown>:0 
  at System.Web.WebPages.WebPageBase.ExecutePageHierarchy
(System.Web.WebPages.WebPageContext pageContext, System.IO.TextWriter
writer, System.Web.WebPages.WebPageRenderingBase startPage) [0x00000] in
<filename unknown>:0 
  at System.Web.Mvc.RazorView.RenderView (System.Web.Mvc.ViewContext
viewContext, System.IO.TextWriter writer, System.Object instance) [0x00000]
in <filename unknown>:0 
  at System.Web.Mvc.BuildManagerCompiledView.Render
(System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer)
[0x00000] in <filename unknown>:0 
  at System.Web.Mvc.ViewResultBase.ExecuteResult
(System.Web.Mvc.ControllerContext context) [0x00000] in <filename unknown>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult
(System.Web.Mvc.ControllerContext controllerContext,
System.Web.Mvc.ActionResult actionResult) [0x00000] in <filename unknown>:0 
  at
System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19
() [0x00000] in <filename unknown>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter
(IResultFilter filter, System.Web.Mvc.ResultExecutingContext preContext,
System.Func`1 continuation) [0x00000] in <filename unknown>:0 

Version information: Mono Runtime Version: 2.10.2 (tarball Mon Apr 18
18:57:39 UTC 2011); ASP.NET Version: 4.0.30319.1

--
View this message in context: http://mono.1490590.n4.nabble.com/ASP-NET-MVC-3-with-Razor-on-Mono-2-10-1-tp3486560p3550550.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list