castleproject / Windsor

Castle Windsor is a best of breed, mature Inversion of Control container available for .NET
http://www.castleproject.org
Apache License 2.0
1.52k stars 456 forks source link

MissingMethodException: IKernel IHandler.GetKernel() #669

Open CollinAlpert opened 8 months ago

CollinAlpert commented 8 months ago

I am occasionally seeing the following exception at startup of my application:

System.MissingMethodException: Method not found: 'Castle.MicroKernel.IKernel Castle.MicroKernel.IHandler.GetKernel()'.
    at Castle.Windsor.Extensions.DependencyInjection.Scope.ExtensionContainerRootScopeAccessor.GetScope(CreationContext context)
    at Castle.MicroKernel.Lifestyle.ScopedLifestyleManager.GetScope(CreationContext context)
    at Castle.MicroKernel.Lifestyle.ScopedLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)
    at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
    at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
    at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)
    at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, Arguments additionalArguments, IReleasePolicy policy, Boolean ignoreParentContext)
    at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext)
    at Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments)
    at Castle.Windsor.WindsorContainer.Resolve(Type service)
    at Castle.Windsor.Extensions.DependencyInjection.WindsorScopedServiceProvider.GetService(Type serviceType)
    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
    at Microsoft.Extensions.Hosting.HostBuilder.ResolveHost(IServiceProvider serviceProvider, DiagnosticListener diagnosticListener)
    at Microsoft.Extensions.Hosting.HostBuilder.Build()

I looked at the implementation of ExtensionContainerRootScopeAccessor.GetScope and am confused at how this could happen. As far as I can tell the implementation does not and never has called any method in IHandler.

I have referenced the following packages:

Implicitly referenced are the following packages:

It looks like I am up to date on all the dependencies and there should be no conflicting versions. Any ideas what this could be?