MissingMethodException - ASP.NET Core 2.1 Application Running Under .NET Full Framework
See original GitHub issueCompany 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…
Issue Analytics
- State:
- Created 9 months ago
- Comments:13 (7 by maintainers)
Top GitHub Comments
ASP.NET Core 2.1 went out of support August 21, 2021 so I would recommend to upgrade to a supported version 👍
Core2.1FullFramework.zip
Reproduction repo for future reference… Upgrading LightInject.Microsoft.DependencyInjection to 3.6.3 solves the issue. Thanks for helping narrow down the issue.