-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The scoped IServiceProvider is passed to AddSingleton in Host V4 #7874
Comments
Here is a sample showing how ASP.NET Core exhibits the correct behavior |
cc @fabiocav this is related to what we were discussing earlier on child containers |
Any updates on this? |
It looks like this is related to making the behaviour behind the “EnableEnhancedScopes” feature flag in v3 the default in v4, which was originally introduced here #6721. We'll continue investigating and are looking to have design discussions on how to address this in the coming sprint. |
Moving to 119, but the work for this has been in PR and approved. @brettsam are you still blocked on anything? We should try to get those changes in so the issues are resolved and we can iterate on follow up items. |
Check for a solution in the Azure portal
Nothing found
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
AddSingleton<T>(Func<IServiceProvider, T> factory)
overload.Expected behavior
The root IServiceProvider passed to singleton registrations.
Actual behavior
Incorrect IServiceProvider is passed.
Known workarounds
Refactoring the code to use the
AddSingletion<T>()
overload works and will give the correct IServiceProvider ifT
has a dependency on IServiceProvider. Here is an example of the workaround we had to use.Related information
Works as expected in Host V3 so this is a regression bug.
The text was updated successfully, but these errors were encountered: