Abp.io Exception: исключение было выдано при активации Castle.Proxies.ProcessesServiceProxy - PullRequest
0 голосов
/ 10 октября 2019

Я все еще новичок с Abp.io , и я получаю следующее исключение. Я следовал инструкциям в документации Abp.io. Пожалуйста, помогите мне узнать, что я пропустил.

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();
});

1 Ответ

2 голосов
/ 10 октября 2019

Что я мог сказать! Проведя всю ночь, прыгая между AutoFac ошибками и некоторыми другими вещами. Я разместил этот вопрос и начал закрывать вкладки моего браузера. Я нашел это 100 Образец Github ☹️ Так что весь трюк здесь.

options.AddDefaultRepositories(includeAllEntities: true);

Пожалуйста, включите этот совет в документацию.

...