Skip to content

MissingMethodException - ASP.NET Core 2.1 Application Running Under .NET Full Framework #585

@bt-Knodel

Description

@bt-Knodel

Company uses an ASP.NET Core 2.1 application running under .NET Full Framework. Unfortunately, it seems that LightInject after 6.6.x is no longer compatible with this API. The exception is:

Exception Info: System.MissingMethodException at LightInject.Microsoft.DependencyInjection.PerRootScopeLifetime.RegisterForDisposal(System.Object) at LightInject.Microsoft.DependencyInjection.PerRootScopeLifetime.GetInstance(LightInject.GetInstanceDelegate, LightInject.Scope, System.Object[]) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(System.IServiceProvider, System.Type) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.IServiceProvider) at Microsoft.AspNetCore.Hosting.WebHostExtensions+<RunAsync>d__4.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(Microsoft.AspNetCore.Hosting.IWebHost) at Clients.Api.Program.Main(System.String[])

Tracking this down, it appears LightInject's package "LightInject.Microsoft.AspNetCore.Hosting". This package appears to look for an overload requiring the parameter to be IDisposable, but it's now an "object" since IAsyncDisposable support...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions