I have an ASP.MVC application that I run in debug mode for development but deploy as a compiled release for the production.
I upgraded from Preview 3 to 5 at the weekend and have deployed a new version of the site.
In my debug environment everything works fine with no exceptions occuring.
In the deployed version I get exceptions similar to the following:
Message: The model item passed into the dictionary is of type 'System.Collections.Generic.PagedList`1[Gymophobics.Models.Fee]' but this dictionary requires a model item of type 'System.Collections.Generic.PagedList`1[Gymophobics.Models.Member]'.
Source: System.Web.Mvc
Stack Trace: at System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value)
at System.Web.Mvc.ViewDataDictionary..ctor(ViewDataDictionary viewDataDictionary)
at System.Web.Mvc.ViewPage`1.SetViewData(ViewDataDictionary viewData)
at System.Web.Mvc.WebFormView.RenderViewPage(ViewContext context, ViewPage page)
at System.Web.Mvc.WebFormView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.ViewResult.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass12.<InvokeActionResultWithFilters>b__f()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass12.<>c__DisplayClass14.<InvokeActionResultWithFilters>b__11()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ActionResult actionResult, IList`1 filters)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext)
at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext)
at System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
If I change the web.config on the compilation element setting debug="true" the site will work with no problems, setting it to "false" will cause it to throw exceptions similar to the one above.
This wasn't a problem in preview 3, any help would be appreciated.
russell@vsdo...
0 Points
1 Post
InvalidOperationException when viewing MVC pages in release mode.
Sep 01, 2008 10:08 AM|LINK
I have an ASP.MVC application that I run in debug mode for development but deploy as a compiled release for the production.
st`1[Gymophobics.Models.Fee]' but this dictionary requires a model item of type 'System.Collections.Generic.PagedList`1[Gymophobics.Models.Member]'..SetModel(Object value)ctor(ViewDataDictionary viewDataDictionary)ta(ViewDataDictionary viewData)ewPage(ViewContext context, ViewPage page)iewContext viewContext, TextWriter writer)sult(ControllerContext context)ker.InvokeActionResult(ActionResult actionResult)ker.<>c__DisplayClass12.<InvokeActionResultWithFilters>b__f()ker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)ker.<>c__DisplayClass12.<>c__DisplayClass14.<InvokeActionResultWithFilters>b__11()ker.InvokeActionResultWithFilters(ActionResult actionResult, IList`1 filters)ker.InvokeAction(ControllerContext controllerContext, String actionName)re()te(RequestContext requestContext)m.Web.Mvc.IController.Execute(RequestContext requestContext)quest(HttpContextBase httpContext)quest(HttpContext httpContext)b.IHttpHandler.ProcessRequest(HttpContext httpContext)lerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()tep(IExecutionStep step, Boolean& completedSynchronously)
I upgraded from Preview 3 to 5 at the weekend and have deployed a new version of the site.
In my debug environment everything works fine with no exceptions occuring.
In the deployed version I get exceptions similar to the following:
Message: The model item passed into the dictionary is of type 'System.Collections.Generic.PagedLi
Source: System.Web.Mvc
Stack Trace: at System.Web.Mvc.ViewDataDictionary`1
at System.Web.Mvc.ViewDataDictionary..
at System.Web.Mvc.ViewPage`1.SetViewDa
at System.Web.Mvc.WebFormView.RenderVi
at System.Web.Mvc.WebFormView.Render(V
at System.Web.Mvc.ViewResult.ExecuteRe
at System.Web.Mvc.ControllerActionInvo
at System.Web.Mvc.ControllerActionInvo
at System.Web.Mvc.ControllerActionInvo
at System.Web.Mvc.ControllerActionInvo
at System.Web.Mvc.ControllerActionInvo
at System.Web.Mvc.ControllerActionInvo
at System.Web.Mvc.Controller.ExecuteCo
at System.Web.Mvc.ControllerBase.Execu
at System.Web.Mvc.ControllerBase.Syste
at System.Web.Mvc.MvcHandler.ProcessRe
at System.Web.Mvc.MvcHandler.ProcessRe
at System.Web.Mvc.MvcHandler.System.We
at System.Web.HttpApplication.CallHand
at System.Web.HttpApplication.ExecuteS
If I change the web.config on the compilation element setting debug="true" the site will work with no problems, setting it to "false" will cause it to throw exceptions similar to the one above.
This wasn't a problem in preview 3, any help would be appreciated.
ASP.NET MVC