ProcessesServiceProxy时引发了异常

ProcessesServiceProxy时引发了异常

本文介绍了Abp.io异常:激活Castle.Proxies.ProcessesServiceProxy时引发了异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Abp.io 还是陌生的,并且遇到了以下异常.我按照Abp.io文档中的说明进行操作.请您帮我知道我想念的是什么.

I'm still new with Abp.io, and I'm getting the following Exception.I followed the instructions in Abp.io Documentation.May you please help me to know what did I miss.

2019-10-10 14:01:46.644 +03:00 [ERR] An exception was thrown while activating Castle.Proxies.ProcessesServiceProxy.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.ProcessesServiceProxy. ---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Castle.Proxies.ProcessesServiceProxy' can be invoked with the available services and parameters:
Cannot resolve parameter 'Volo.Abp.Domain.Repositories.IRepository`2[AIL.WorkflowEngine.Processes.Process,System.Int32] repository' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[], Volo.Abp.Domain.Repositories.IRepository`2[AIL.WorkflowEngine.Processes.Process,System.Int32])'.
   at Autofac.Core.Activators.Reflection.ReflectionActivator.GetValidConstructorBindings(IComponentContext context, IEnumerable`1 parameters) in C:\projects\autofac\src\Autofac\Core\Activators\Reflection\ReflectionActivator.cs:line 160
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) in C:\projects\autofac\src\Autofac\Core\Activators\Reflection\ReflectionActivator.cs:line 120
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 117
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 135
   at Autofac.Core.Resolving.InstanceLookup.Execute() in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 83
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) in C:\projects\autofac\src\Autofac\Core\Resolving\ResolveOperation.cs:line 131
   at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) in C:\projects\autofac\src\Autofac\Core\Resolving\ResolveOperation.cs:line 84
   at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) in C:\projects\autofac\src\Autofac\ResolutionExtensions.cs:line 1041
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) in C:\projects\autofac\src\Autofac\ResolutionExtensions.cs:line 871
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
2019-10-10 14:01:46.645 +03:00 [ERR] ---------- Exception Data ----------
2019-10-10 14:01:46.645 +03:00 [ERR] ActivatorChain = Castle.Proxies.ProcessesServiceProxy
2019-10-10 14:01:46.645 +03:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
2019-10-10 14:01:46.646 +03:00 [INF] Executed action AIL.WorkflowEngine.Processes.ProcessesService.GetListAsync (AIL.WorkflowEngine.Application) in 4.636ms
2019-10-10 14:01:46.646 +03:00 [INF] Request finished in 9.6394ms 500 application/json; charset=utf-8

我也已经叫 UseAutofac

services.AddApplication<TrisWebUnifiedModule>(options =>
{
    options.UseAutofac();
});

推荐答案

我能说什么!在整夜中,在 AutoFac 错误和其他一些东西之间跳转之后.我发布了这个问题,并开始关闭我的研究浏览器标签.我找到了这个 Github示例☹️所以整个窍门就在这里.

What could I say! After spending the whole night jumping between AutoFac errors and some other things. I posted this question, and start closing my research browser tabs. I found this☹️ Github sample ☹️So the whole trick is here.

options.AddDefaultRepositories(includeAllEntities: true);

请在文档中包含此提示.

Please include this tip in documentation.

这篇关于Abp.io异常:激活Castle.Proxies.ProcessesServiceProxy时引发了异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 10:39