具体问题如下:
An exception was thrown while activating Castle.Proxies.XXXApp
ServiceProxy.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.XXXAppServiceProxy.
---> Autofac.Core.DependencyResolutionException: None of the constructors found
with 'Volo.Abp.Autofac.AbpAutofacConstructorFinder' on type 'Castle.Proxies.Not
iceAppServiceProxy' can be invoked with the available services and parameters:
Cannot resolve parameter
'Volo.Abp.Domain.Repositories.IRepository`2[SJ.ABP.XXXCenter.XXXs.XXX,System.Guid] repository' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[],
Volo.Abp.Domain.Repositories.IRepository`2[SJ.ABP.XXXCenter.XXXs.XXX,System.Guid])'.
at Autofac.Core.Activators.Reflection.ReflectionActivator.GetAllBindings(Cons
tructorBinder[] availableConstructors, IComponentContext context, IEnumerable`1
parameters)
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IC
omponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Activators.Reflection.ReflectionActivator.<ConfigurePipeline>
b__11_0(ResolveRequestContext ctxt, Action`1 next)
at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(Resol
veRequestContext context, Action`1 next)
at Autofac.Builder.RegistrationBuilder`3.<>c__DisplayClass41_0.<PropertiesAut
owired>b__0(ResolveRequestContext ctxt, Action`1 next)
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute
(ResolveRequestContext context, Action`1 next)
--- End of inner exception stack trace ---
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute
(ResolveRequestContext context, Action`1 next)
at Autofac.Builder.RegistrationBuilder`3.<>c__DisplayClass35_0.<OnPreparing>b
__0(ResolveRequestContext ctxt, Action`1 next)
at Autofac.Core.Resolving.Middleware.CoreEventMiddleware.Execute(ResolveReque
stContext context, Action`1 next)
at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequest
Context context, Action`1 next)
at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Exe
cute(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifeti
meScope currentOperationScope, ResolveRequest request)
at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest re
quest)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context,
Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Ser
vice service, IEnumerable`1 parameters)
at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Creat
e(ControllerContext actionContext)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__Displa
yClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext contr
ollerContext)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State
& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInne
rFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExcepti
onFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next
, Scope scope, Object state, Boolean isCompleted)
[21:43:28 ERR] ---------- Exception Data ----------
ActivatorChain = Castle.Proxies.XXXAppServiceProxy
解决方案:
如下图,缺少数据库对应表的映射,把相应的表增加进来就好了;