question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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…

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
seesharpercommented, Jan 5, 2023

ASP.NET Core 2.1 went out of support August 21, 2021 so I would recommend to upgrade to a supported version 👍

0reactions
bt-Knodelcommented, Jan 5, 2023

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MissingMethodException on ASP.NET Core ...
Open Visual Studio 2019; Create a new ASP.NET Core Web Application; Select .NET Framework; ConfigureServices in Startup with: services.
Read more >
MissingMethodException Class (System)
The exception that is thrown when there is an attempt to dynamically access a method that does not exist.
Read more >
How do I overcome MissingMethodException please. Am ...
net core 2.1 using AlanJudenMvcReportViewer which is working ok on about a dozen SSRS server reports. Decided to use Microsoft.DotNet.
Read more >
Why isn't my ASP.NET Core app in Docker working?
In this post I describe a problem where my ASP.NET Core app in Docker wasn't responding to requests. This post debugs and diagnoses...
Read more >
Working with IWebHostEnvironment and IHostingEnvironment ...
In ASP.NET Core 3.x Microsoft introduced a new `IWebHostEnvironment` to replace the obsoleted `IHostingEnvironment`. While that works for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found