SHARE
TWEET

Upgraded project to Visual Studio 2010, but now get MVC error

a guest Feb 21st, 2012 18 Never
  1. No parameterless constructor defined for this object.
  2. 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.
  3.  
  4. Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.
  5.  
  6. Source Error:
  7.  
  8. 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.
  9.  
  10. Stack Trace:
  11.  
  12. [MissingMethodException: No parameterless constructor defined for this object.]
  13.    System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
  14.    System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
  15.    System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
  16.    System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
  17.    System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(Type controllerType) +82
  18.  
  19. [InvalidOperationException: An error occurred while creating a controller of type 'PartingOut.Web.Controllers.HomeController'. If the controller doesn't have a controller factory, ensure that it has a parameterless public constructor.]
  20.    System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(Type controllerType) +189
  21.    System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +74
  22.    System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +128
  23.    System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57
  24.    System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
  25.    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
  26.    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
RAW Paste Data
Top