November Happy Hour will be moved to Thursday December 5th.

CheckoutController init exception after adding meta field.

Vote:
 

Hi!

After adding a metafield to the Commerce object Cart Order Class and Purchase Order we no longer can load the CheckoutController without exception:

Server Error in '/' Application.
No parameterless constructor defined for this object.
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: No parameterless constructor defined for this object.

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: No parameterless constructor defined for this object.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +197
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +114
   System.Activator.CreateInstance(Type type) +11
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +72

[InvalidOperationException: An error occurred when trying to create a controller of type 'Designonline.Site.Features.Checkout.Controllers.CheckoutController'. Make sure that the controller has a parameterless public constructor.]
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +239
   System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +103
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +293
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +104
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1939
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +2622
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +973

We ha rebuilt and restarted several times without luck, what are we missing?

We are using Commerce 10.7 built on QuickSilver.

Thanks!

/Kristoffer

#180439
Jul 10, 2017 17:12
Vote:
 

Hi,

What is the code (or at least the constructor) of your CheckoutController? Mind sharing it here? 

#180440
Jul 10, 2017 17:44
Vote:
 

I had nothing to do with it actually. I was another component that was initiated in the constuctor that needed payment settings that not all configurations had. We added a meta field at the at the same time, there for we thought it had to do with that.

/Kristoffer

#180441
Jul 10, 2017 18:04
Vote:
 

" I was another component that was initiated in the constuctor that needed payment settings that not all configurations had." => I would suspect this was the problem 

#180446
Jul 11, 2017 8:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.