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

Fix ServiceDescriptor access when Keyed Services are present #2676

Merged
merged 3 commits into from
Feb 25, 2024

Conversation

ReubenBond
Copy link
Contributor

@ReubenBond ReubenBond commented Feb 13, 2024

Fix ServiceDescriptor access when Keyed Services are present

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Fixes the use of ServiceDescriptor for containers which have keyed services present. This can be an issue on .NET 8.0 and has been reported by some users of the library here: #2604

Description

The issue is caused by unconditional access to ServiceDescriptor.ImplementationType and the fix is to first check whether ServiceDescriptor.ServiceKey is set. If it is, we can safely ignore that descriptor.

For more information on keyed services, see the dotnet/runtime thread here: dotnet/runtime#64427 and the PR here: dotnet/runtime#87183.

Fixes #2604

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Collaborator

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ReubenBond

LGTM

@adityamandaleeka
Copy link

Can this be merged now?

@onionhammer
Copy link

This seems like something that should be fixed sooner rather than later...

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:
Thanks for the contribution @ReubenBond

@jennyf19 jennyf19 added this to the 2.17.1 milestone Feb 25, 2024
@jennyf19 jennyf19 merged commit b6cc9eb into AzureAD:master Feb 25, 2024
@vijuhe
Copy link

vijuhe commented Feb 27, 2024

Can this be released now or very soon at least? There is still one open feature in the release 2.17.1. Can the release be done without it?

@jennyf19
Copy link
Collaborator

@vijuhe we are testing the 2.17.1. It should be out later today PST.

@jennyf19
Copy link
Collaborator

Included in 2.17.1 Thanks @ReubenBond

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