4

Plenty of pages load since upgrading my site from MVC 1.0 but if I go to a page that uses a querystring then I get this error:

[EntryPointNotFoundException: Entry point was not found.]
System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +219
System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +109
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +399
System.Web.Mvc.Controller.ExecuteCore() +126
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +27
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +151
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Edit

I thought this was related to structuremap as MVC 2 broke the model so I changed the DefaultControllerFactory but I have been able to pull data out of the db so structuremap isn't the issue?

protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
    {
        try
        {                
            return ObjectFactory.GetInstance(controllerType) as Controller;

        }
        catch (StructureMapException)
        {
            System.Diagnostics.Debug.WriteLine(ObjectFactory.WhatDoIHave());
            throw;
        }
    }
KevinUK
  • 5,053
  • 5
  • 33
  • 49
  • Have the same problem debbuged a little and for me it's not the controllerfactory that is the problem. It's because I have a parameter in my Index method on my HomeController. – Magnus Bertilsson Jul 31 '09 at 14:07
  • That's right. It only happens on methods with parameters. I can call data from the database and display it on the page so structuremap IS working. Where could the problem be then? :-/ – KevinUK Jul 31 '09 at 15:08

1 Answers1

2

Have you added assembly-binding to your project? I have nearly the same error and it solves problem for me. From release notes:

4.  If the project references any third-party libraries that are compiled against ASP.NET MVC 1.0, add the following bindingRedirect element to the Web.config file in the application root under the configuaton section:
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Mvc" 
          publicKeyToken="31bf3856ad364e35"/>
      <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>
Pavel Samokha
  • 1,121
  • 1
  • 8
  • 11
  • Thanks that did it. Ah I just thought, I should recompile the projects and re-bind the dlls. I was trying to think of any dlls that I hadn't written myself! – KevinUK Jul 31 '09 at 17:51