You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
We're mistakenly keeping references to filters even when they say they aren't reusable. This creates all kinds of use-after-dispose problems, and will break apps that worked in RC1.
We're mistakenly keeping references to filters even when they say they aren't reusable. This creates all kinds of use-after-dispose problems, and will break apps that worked in RC1.
The bug is here: https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Core/Internal/ControllerActionInvokerCache.cs#L59
The
GetFilters
method is too granular, the same logic can't work for the 'first time' and for the cached case.To repro this add a filter like:
Register it as a scoped service:
services.AddScoped<MyFilter, MyFilter>();
Add it as a
ServiceFilter
:You'll see an exception on the third request.
Output is like
Notice that the object with ID 48094426 gets used twice
The text was updated successfully, but these errors were encountered: