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

来源:互联网 发布:太极软件 政务 编辑:程序博客网 时间:2024/05/17 00:57
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type '***' can be invoked with the available services and parameters:

Cannot resolve parameter '***' of constructor 'Void .ctor(***)'.


  • DependencyRegistrar注册

builder.RegisterType<***Service>().As<I***Service>().InstancePerLifetimeScope();

  • 构造函数注入

必须注入接口,非实现

  • 接口必须有实现


0 0
原创粉丝点击