У нас есть большое решение с 24 проектами, в которых используется AutofaC (v3.5.2) и в значительной степени конструктор DI для построения всех наших услуг. В достижении предела. Недавно я добавил еще несколько конструкторов в существующую службу, и когда я загружаю и запускаю проект, я теперь получаю OutofmemoryException. Если я удалю эти новые DIS в этой службе, проект снова загружается. Вопрос в том, есть ли у Autofac такой тип предела? Если нет, то что может вызвать это OutOfMemoryException?
[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
Autofac.Core.Activators.Reflection.AutowiringParameter.CanSupplyValue(ParameterInfo pi, IComponentContext context, Func`1& valueProvider) +246
Autofac.Core.Activators.Reflection.ConstructorParameterBinding..ctor(ConstructorInfo ci, IEnumerable`1 availableParameters, IComponentContext context) +435
Autofac.Core.Activators.Reflection.c__DisplayClass13_0.b__0(ConstructorInfo ci) +67
System.Linq.WhereSelectArrayIterator`2.MoveNext() +58
System.Linq.WhereEnumerableIterator`1.MoveNext() +174
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +135
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +79
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +518
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
[DependencyResolutionException:
An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (ReflectionActivator),
Services = [MyCoolApp.Domain.IUserRetriever],
Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None,
Ownership = OwnedByLifetimeScope ---> Exception of type 'System.OutOfMemoryException' was thrown. (See inner exception for details.)]
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +274
Autofac.Core.Resolving.InstanceLookup.Execute() +341
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +281
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
Autofac.Core.Registration.c__DisplayClass2_0.b__2(IComponentContext c, IEnumerable`1 p) +57
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +188
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
[DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (DelegateActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (ReflectionActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> Exception of type 'System.OutOfMemoryException' was thrown. (See inner exception for details.) (See inner exception for details.)]
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +274
Autofac.Core.Resolving.InstanceLookup.Execute() +341
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +281
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
Autofac.Core.Activators.Reflection.c__DisplayClass0_0.b__0() +82
Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +328
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +622
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
[DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserService (ReflectionActivator), Services = [MyCoolApp.Domain.Users.IUserService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (DelegateActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (ReflectionActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> Exception of type 'System.OutOfMemoryException' was thrown. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)]
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +274
Autofac.Core.Resolving.InstanceLookup.Execute() +341
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +281
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
Autofac.Core.Registration.c__DisplayClass2_0.b__2(IComponentContext c, IEnumerable`1 p) +57
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +188
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
[DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserService (DelegateActivator), Services = [MyCoolApp.Domain.Users.IUserService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserService (ReflectionActivator), Services = [MyCoolApp.Domain.Users.IUserService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (DelegateActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (ReflectionActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> Exception of type 'System.OutOfMemoryException' was thrown. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)]
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +274
Autofac.Core.Resolving.InstanceLookup.Execute() +341
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +281
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
Autofac.Core.Activators.Reflection.c__DisplayClass0_0.b__0() +82
Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +328
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +622
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
...
< /code>
Полный трассировка стека слишком большой, чтобы публиковать переполнение стека, но вы можете здесь полную трассу. зависимости, но не круговой. Каждый раз, когда мы загружаем приложение, ошибка следует за различной цепочкой зависимости в сообщениях об ошибках. Вот одна цепочка в качестве примера: < /p>
RelatedEntityResolver -> IPermissionService
RoleResolver -> IRelatedEntityResolver
-> IPermissionService
UserRetriever -> IRelatedEntityResolver
-> IRoleResolver
-> IPermissionService
UserService -> IUserRetriever
RoleService -> IPermissionService
-> IRoleResolver
-> IRelatedEntityResolver
-> IUserRetriever
-> IUserService
TeamFactory -> IPermissionService
-> IRoleService
TeamInstanceForCompetitionCreator -> ITeamFactory
CommandDispatcher -> ICommandHandler/ITeamInstanceForCompetitionCreator
CreateAgreement -> ICommandDispatcher
Подробнее здесь: https://stackoverflow.com/questions/794 ... registered
Есть ли у Autofac ограничения на то, сколько компонентов может быть зарегистрировано? ⇐ C#
Место общения программистов C#
1739702412
Anonymous
У нас есть большое решение с 24 проектами, в которых используется AutofaC (v3.5.2) и в значительной степени конструктор DI для построения всех наших услуг. В достижении предела. Недавно я добавил еще несколько конструкторов в существующую службу, и когда я загружаю и запускаю проект, я теперь получаю OutofmemoryException. Если я удалю эти новые DIS в этой службе, проект снова загружается. Вопрос в том, есть ли у Autofac такой тип предела? Если нет, то что может вызвать это OutOfMemoryException?
[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
Autofac.Core.Activators.Reflection.AutowiringParameter.CanSupplyValue(ParameterInfo pi, IComponentContext context, Func`1& valueProvider) +246
Autofac.Core.Activators.Reflection.ConstructorParameterBinding..ctor(ConstructorInfo ci, IEnumerable`1 availableParameters, IComponentContext context) +435
Autofac.Core.Activators.Reflection.c__DisplayClass13_0.b__0(ConstructorInfo ci) +67
System.Linq.WhereSelectArrayIterator`2.MoveNext() +58
System.Linq.WhereEnumerableIterator`1.MoveNext() +174
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +135
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +79
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +518
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
[DependencyResolutionException:
An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (ReflectionActivator),
Services = [MyCoolApp.Domain.IUserRetriever],
Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None,
Ownership = OwnedByLifetimeScope ---> Exception of type 'System.OutOfMemoryException' was thrown. (See inner exception for details.)]
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +274
Autofac.Core.Resolving.InstanceLookup.Execute() +341
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +281
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
Autofac.Core.Registration.c__DisplayClass2_0.b__2(IComponentContext c, IEnumerable`1 p) +57
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +188
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
[DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (DelegateActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (ReflectionActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> Exception of type 'System.OutOfMemoryException' was thrown. (See inner exception for details.) (See inner exception for details.)]
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +274
Autofac.Core.Resolving.InstanceLookup.Execute() +341
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +281
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
Autofac.Core.Activators.Reflection.c__DisplayClass0_0.b__0() +82
Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +328
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +622
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
[DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserService (ReflectionActivator), Services = [MyCoolApp.Domain.Users.IUserService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (DelegateActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (ReflectionActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> Exception of type 'System.OutOfMemoryException' was thrown. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)]
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +274
Autofac.Core.Resolving.InstanceLookup.Execute() +341
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +281
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
Autofac.Core.Registration.c__DisplayClass2_0.b__2(IComponentContext c, IEnumerable`1 p) +57
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +188
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
[DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserService (DelegateActivator), Services = [MyCoolApp.Domain.Users.IUserService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserService (ReflectionActivator), Services = [MyCoolApp.Domain.Users.IUserService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (DelegateActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = UserRetriever (ReflectionActivator), Services = [MyCoolApp.Domain.IUserRetriever], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> Exception of type 'System.OutOfMemoryException' was thrown. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)]
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +274
Autofac.Core.Resolving.InstanceLookup.Execute() +341
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +281
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
Autofac.Core.Activators.Reflection.c__DisplayClass0_0.b__0() +82
Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +328
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +622
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +124
...
< /code>
Полный трассировка стека слишком большой, чтобы публиковать переполнение стека, но вы можете здесь полную трассу. зависимости, но не круговой. Каждый раз, когда мы загружаем приложение, ошибка следует за различной цепочкой зависимости в сообщениях об ошибках. Вот одна цепочка в качестве примера: < /p>
RelatedEntityResolver -> IPermissionService
RoleResolver -> IRelatedEntityResolver
-> IPermissionService
UserRetriever -> IRelatedEntityResolver
-> IRoleResolver
-> IPermissionService
UserService -> IUserRetriever
RoleService -> IPermissionService
-> IRoleResolver
-> IRelatedEntityResolver
-> IUserRetriever
-> IUserService
TeamFactory -> IPermissionService
-> IRoleService
TeamInstanceForCompetitionCreator -> ITeamFactory
CommandDispatcher -> ICommandHandler/ITeamInstanceForCompetitionCreator
CreateAgreement -> ICommandDispatcher
Подробнее здесь: [url]https://stackoverflow.com/questions/79440309/does-autofac-have-limitations-on-how-many-components-can-be-registered[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия