None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder'

后端 未结 1 1346
半阙折子戏
半阙折子戏 2021-01-20 03:56

I get the following error message:

System.InvalidOperationException: An error occurred when trying to create a controller of type \'App.Web.Contro

相关标签:
1条回答
  • 2021-01-20 04:24

    The error message tells you that :

    Cannot resolve parameter 'App.Service.IWizardTypeStepService wizardTypeStepService'

    Your registration of the corresponding service is like this :

    // Services
    builder.RegisterAssemblyTypes(typeof(AppBrandService).Assembly)
       .Where(t => t.Name.EndsWith("Service"))
       .AsImplementedInterfaces()
       .InstancePerRequest();
    

    But if you look at WizardTypeStepService, it doesn't implement any interfaces. Implement IWizardTypeStepService and your error should disappear.

    0 讨论(0)
提交回复
热议问题