This project is read-only.

Admin/Polls Page Throws Error (MVC Version)

Topics: User Forum
Aug 19, 2010 at 10:00 PM

I am receiving the below error when trying to access admin/polls.  The error is thrown before the controller is even hit, not sure how to track down the problem.

I have not modified anything from the source code I downloaded from this site.  I have however, converted this project to a 2010 project, but left the framework targeted at 3.5.

The route is setup as:

routes.MapRoute(
                "PollManager",
                "admin/polls",
                new { controller = "Poll", action = "ManagePolls", page = 1 }
            );

 

The ManagePolls action in the PollController is:

[Authorize(Roles = "Editor")]
        public ActionResult ManagePolls([Default(1)]int page)
        {
            TheBeerHouseDataContext dc = new TheBeerHouseDataContext();
            var viewData = dc.Polls.GetPolls(null, page);

            ViewData["PageTitle"] = "Manage Polls";
            return View(viewData);
        }

 

Method not found: 'System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult> System.Web.Mvc.ModelBindingContext.get_ValueProvider()'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: 'System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult> System.Web.Mvc.ModelBindingContext.get_ValueProvider()'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[MissingMethodException: Method not found: 'System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult> System.Web.Mvc.ModelBindingContext.get_ValueProvider()'.]
ManagedFusion.Web.Mvc.DefaultValueModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) in C:\Users\Nick\Documents\Projects\Managed Fusion\ManagedFusion.Web\Source\Web\Mvc\DefaultAttribute.cs:98
System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +257
System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +109
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +314
System.Web.Mvc.Controller.ExecuteCore() +105
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +39
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +59
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +44
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8678910
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Aug 19, 2010 at 10:20 PM

Update:  I downloaded the project again and did not upgrade the project to 2010.  It works now.  Would still love to hear if anybody knows how to resolve this issue.  If not maybe I'll know how to resolve it by the time I get though the entire book.

 

 

Oct 26, 2010 at 9:07 AM

Did You find it solution ? i have same problem :(

Nov 2, 2010 at 10:41 PM

Yes, I did find a solution.  See this post for how I updated the project for 2010. Starting with reply 2.  http://thebeerhouse.codeplex.com/Thread/View.aspx?ThreadId=224190