我正在将.Net Core 2.2用于我的Web项目。我有一些测试用例,它们是在Linux docker中使用dotnet vstest作为CI管道的一部分执行的。有时执行失败并出现以下堆栈:
错误消息:
> OneTimeSetUp: Autofac.Core.DependencyResolutionException : An error
> occurred during the activation of a particular registration. See the
> inner exception for details. Registration: Activator = MvcRouteHandler
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandler], Lifetime =
> Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership =
> OwnedByLifetimeScope ---> An error occurred during the activation of a
> particular registration. See the inner exception for details.
> Registration: Activator = ActionInvokerFactory (ReflectionActivator),
> Services =
> [Microsoft.AspNetCore.Mvc.Infrastructure.IActionInvokerFactory],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An error occurred during the
> activation of a particular registration. See the inner exception for
> details. Registration: Activator = IActionInvokerProvider[]
> (DelegateActivator), Services =
> [System.Collections.Generic.IEnumerable`1[[Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProvider,
> Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0,
> Culture=neutral, PublicKeyToken=adb9793829ddae60]]], 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 = ControllerActionInvokerProvider
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProvider],
> 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 = ControllerActionInvokerCache
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An error occurred during the
> activation of a particular registration. See the inner exception for
> details. Registration: Activator =
> DefaultActionDescriptorCollectionProvider (ReflectionActivator),
> Services =
> [Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProvider],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An exception was thrown while
> invoking the constructor 'Void
> .ctor(System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProvider],
> System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorChangeProvider])'
> on type 'DefaultActionDescriptorCollectionProvider'. ---> The
> configured user limit (128) on the number of inotify instances has
> been reached. (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) ---->
> Autofac.Core.DependencyResolutionException : An error occurred during
> the activation of a particular registration. See the inner exception
> for details. Registration: Activator = ActionInvokerFactory
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Infrastructure.IActionInvokerFactory],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An error occurred during the
> activation of a particular registration. See the inner exception for
> details. Registration: Activator = IActionInvokerProvider[]
> (DelegateActivator), Services =
> [System.Collections.Generic.IEnumerable`1[[Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProvider,
> Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0,
> Culture=neutral, PublicKeyToken=adb9793829ddae60]]], 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 = ControllerActionInvokerProvider
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProvider],
> 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 = ControllerActionInvokerCache
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An error occurred during the
> activation of a particular registration. See the inner exception for
> details. Registration: Activator =
> DefaultActionDescriptorCollectionProvider (ReflectionActivator),
> Services =
> [Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProvider],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An exception was thrown while
> invoking the constructor 'Void
> .ctor(System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProvider],
> System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorChangeProvider])'
> on type 'DefaultActionDescriptorCollectionProvider'. ---> The
> configured user limit (128) on the number of inotify instances has
> been reached. (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) (See inner exception
> for details.) ----> Autofac.Core.DependencyResolutionException : An
> error occurred during the activation of a particular registration. See
> the inner exception for details. Registration: Activator =
> IActionInvokerProvider[] (DelegateActivator), Services =
> [System.Collections.Generic.IEnumerable`1[[Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProvider,
> Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0,
> Culture=neutral, PublicKeyToken=adb9793829ddae60]]], 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 = ControllerActionInvokerProvider
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProvider],
> 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 = ControllerActionInvokerCache
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An error occurred during the
> activation of a particular registration. See the inner exception for
> details. Registration: Activator =
> DefaultActionDescriptorCollectionProvider (ReflectionActivator),
> Services =
> [Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProvider],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An exception was thrown while
> invoking the constructor 'Void
> .ctor(System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProvider],
> System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorChangeProvider])'
> on type 'DefaultActionDescriptorCollectionProvider'. ---> The
> configured user limit (128) on the number of inotify instances has
> been reached. (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) ---->
> Autofac.Core.DependencyResolutionException : An error occurred during
> the activation of a particular registration. See the inner exception
> for details. Registration: Activator = ControllerActionInvokerProvider
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProvider],
> 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 = ControllerActionInvokerCache
> (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An error occurred during the
> activation of a particular registration. See the inner exception for
> details. Registration: Activator =
> DefaultActionDescriptorCollectionProvider (ReflectionActivator),
> Services =
> [Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProvider],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An exception was thrown while
> invoking the constructor 'Void
> .ctor(System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProvider],
> System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorChangeProvider])'
> on type 'DefaultActionDescriptorCollectionProvider'. ---> The
> configured user limit (128) on the number of inotify instances has
> been reached. (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) (See inner exception
> for details.) ----> Autofac.Core.DependencyResolutionException : An
> error occurred during the activation of a particular registration. See
> the inner exception for details. Registration: Activator =
> ControllerActionInvokerCache (ReflectionActivator), Services =
> [Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An error occurred during the
> activation of a particular registration. See the inner exception for
> details. Registration: Activator =
> DefaultActionDescriptorCollectionProvider (ReflectionActivator),
> Services =
> [Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProvider],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An exception was thrown while
> invoking the constructor 'Void
> .ctor(System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProvider],
> System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorChangeProvider])'
> on type 'DefaultActionDescriptorCollectionProvider'. ---> The
> configured user limit (128) on the number of inotify instances has
> been reached. (See inner exception for details.) (See inner exception
> for details.) (See inner exception for details.) ---->
> Autofac.Core.DependencyResolutionException : An error occurred during
> the activation of a particular registration. See the inner exception
> for details. Registration: Activator =
> DefaultActionDescriptorCollectionProvider (ReflectionActivator),
> Services =
> [Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProvider],
> Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared,
> Ownership = OwnedByLifetimeScope ---> An exception was thrown while
> invoking the constructor 'Void
> .ctor(System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProvider],
> System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorChangeProvider])'
> on type 'DefaultActionDescriptorCollectionProvider'. ---> The
> configured user limit (128) on the number of inotify instances has
> been reached. (See inner exception for details.) (See inner exception
> for details.) ----> Autofac.Core.DependencyResolutionException : An
> exception was thrown while invoking the constructor 'Void
> .ctor(System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProvider],
> System.Collections.Generic.IEnumerable`1[Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorChangeProvider])'
> on type 'DefaultActionDescriptorCollectionProvider'. ---> The
> configured user limit (128) on the number of inotify instances has
> been reached. (See inner exception for details.) ---->
> System.IO.IOException : The configured user limit (128) on the number
> of inotify instances has been reached.
我看过类似的帖子
但是我在启动方法中没有使用JSON文件。只是想知道出了什么问题。