ABP Vnext 出现 Autofac.Core.DependencyResolutionException: None of the constructors found with ‘Autofac.Core.Activators
调用ABP接口时出现以下异常
2022-06-24 11:41:58.983 +08:00 [ERR] An exception was thrown while activating Castle.Proxies.RedeemSuccessCodeServiceProxy.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.RedeemSuccessCodeServiceProxy.
---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Castle.Proxies.RedeemSuccessCodeServiceProxy' can be invoked with the available services and parameters:
Cannot resolve parameter 'CamBook.Domain.UserRecord.RedeemCode.IRedeemSuccessRepository redeemSuccessRepository' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[], CamBook.Domain.UserRecord.RedeemCode.IRedeemSuccessRepository)'.
at Autofac.Core.Activators.Reflection.ReflectionActivator.GetAllBindings(ConstructorBinder[] availableConstructors, IComponentContext context, IEnumerable`1 parameters)
具体服务类如下:
构造函数也运行不到,直接报上面错误;
网上说没有定义DBSet,实际上已经定义了DBSet
IRedeemSuccessRepository的定义如下:
也有对应的实现类,如下:
对应的实体类定义如下:
回答
有没有注册 IRedeemSuccessRepository 的实现 EfCoreReSuccessRepository?