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

Do not allow a non-keyed service to be injected to a keyed parameter #105839

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

steveharter
Copy link
Member

Fixes #102204

@steveharter steveharter added this to the 9.0.0 milestone Aug 1, 2024
@steveharter steveharter self-assigned this Aug 1, 2024
@steveharter steveharter added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Aug 1, 2024
@dotnet-policy-service dotnet-policy-service bot added the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Aug 1, 2024
}

[Fact]
public void ResolveKeyedServiceWithKeyedParameter_MissingRegistrationButWithUnkeyedService()
Copy link
Member Author

Choose a reason for hiding this comment

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

The above tests were not failing before this PR, but this test and the other new test in "ServiceProviderContainerTests.cs" were.

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

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

Code change looks good. Thank you for marking this breaking. Let's make sure to get the breaking change doc filled along with a workaround.

@steveharter steveharter merged commit 208c40b into dotnet:main Aug 7, 2024
80 of 84 checks passed
@steveharter steveharter deleted the Issue102204 branch August 7, 2024 18:46
@steveharter
Copy link
Member Author

/backport to release/8.0-staging

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/10525564051

@steveharter
Copy link
Member Author

Breaking change doc at: dotnet/docs#42313

@steveharter steveharter removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Extensions-DependencyInjection breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different behavior of FromKeyedServices attribute in Minimal APIs handler vs class library
3 participants