I am getting below error when I drag a form element on form designer. I think it is because of dependency injection. I am using ninject DI in my application. Looking for help how to handle dependencies for Sitecore forms.

Here is error:

Exception: Ninject.ActivationException
Message: Error activating IListDataSourceDefinitionProvider
No matching bindings are available, and the type is not self-bindable.

Activation path:

  1. Injection of dependency IListDataSourceDefinitionProvider into parameter listDataSourceDefinitionProvider of constructor of type FormFieldController

  2. Request for FormFieldController


  1. Ensure that you have defined a binding for IListDataSourceDefinitionProvider.
  2. If the binding was defined in a module, ensure that the module has been loaded into the kernel.
  3. Ensure you have not accidentally created more than one kernel.
  4. If you are using constructor arguments, ensure that the parameter name matches the constructors parameter name.
  5. If you are using automatic module loading, ensure the search path and filters are correct.

    Source: Ninject
     at Ninject.KernelBase.Resolve(IRequest request, Boolean handleMissingBindings)
     at Ninject.Planning.Targets.Target1.ResolveWithin(IContext parent)
     at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()
     at System.Linq.Buffer1..ctor(IEnumerable1 source)
     at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
     at Ninject.Activation.Providers.StandardProvider.Create(IContext context)
     at Ninject.Activation.Context.ResolveInternal(Object scope)
     at Ninject.Activation.Context.Resolve()
     at Ninject.KernelBase.Resolve(IRequest request, Boolean handleMissingBindings)
     at Ninject.ResolutionExtensions.Get(IResolutionRoot root, Type service, IParameter[] parameters)
     at Cerner.IoC.Factories.NinjectControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
     at Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.