Skip to content
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

WIP fix: dispose IServiceProvider in MicrosoftDependencyResolver #1170

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

calebkiage
Copy link

What kind of change does this PR introduce?
Bug fix

What is the current behavior?

#1168

What is the new behavior?

What might this PR break?

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

@dpvreony
Copy link
Member

dpvreony commented Jul 31, 2024

thanks.

just need to review. need to assess whether it can dispose a collection being managed externally

@dpvreony dpvreony changed the title fix: dispose IServiceProvider in MicrosoftDependencyResolver WIP fix: dispose IServiceProvider in MicrosoftDependencyResolver Jul 31, 2024
@calebkiage
Copy link
Author

As far as I know, a ServiceCollection is not disposable and doesn't hold service instances. Only the ServiceProvider is.

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 23.07692% with 20 lines in your changes missing coverage. Please review.

Project coverage is 71.47%. Comparing base (1803c70) to head (5930e17).
Report is 139 commits behind head on main.

Files with missing lines Patch % Lines
...DependencyInjection/MicrosoftDependencyResolver.cs 23.07% 19 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1170      +/-   ##
==========================================
- Coverage   71.87%   71.47%   -0.40%     
==========================================
  Files          96       96              
  Lines        4483     4453      -30     
  Branches      569      566       -3     
==========================================
- Hits         3222     3183      -39     
- Misses       1074     1085      +11     
+ Partials      187      185       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpvreony
Copy link
Member

dpvreony commented Aug 5, 2024

As far as I know, a ServiceCollection is not disposable and doesn't hold service instances. Only the ServiceProvider is.

it might well be fine. i just want to check around MicrosoftDependencyResolver(IServiceProvider serviceProvider) and UpdateContainer(...) as there's been a few things in this provider that have needed tweaking :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants