Fix binary incompatibility introduced by 4.4.0#582
Merged
zhiyuanliang-ms merged 1 commit intomicrosoft:mainfrom Mar 4, 2026
Merged
Conversation
Member
|
Hey, @richardszalay Thanks for pointing this out. This is an oversight. Sorry for that. |
zhiyuanliang-ms
approved these changes
Mar 2, 2026
| public ConfigurationFeatureDefinitionProvider( | ||
| IConfiguration configuration, | ||
| ConfigurationFeatureDefinitionProviderOptions options = null) | ||
| ConfigurationFeatureDefinitionProviderOptions options) |
Member
There was a problem hiding this comment.
Could you please add a test to verify that DI will pick the ctor with most parameters?
Contributor
Author
There was a problem hiding this comment.
I don't think that's necessary, for two reasons:
- The library doesn't rely on DI (ref) to construct ConfigurationFeatureDefinitionProviderOptions - it always new's it up inline
- The MS DI Constructor selection rules are quite clear: the constructor with the most arguments is used
Member
There was a problem hiding this comment.
Referencing implementation shouldn't be used to justify tests. Otherwise, we wouldn't need tests, we could just say look at the code, it works.
The thing that needs coverage is if ConfigurationFeatureDefinitionProviderOptions are registered, then they are respected.
@zhiyuanliang-ms , I believe that's covered here, can you confirm?
Member
|
Thank you for your contribution! @richardszalay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this PR?
4.4.0 introduced a change to
ConfigurationFeatureDefinitionProvider, adding a nullable argument to the existing constructor. This was source compatible, but not binary incompatible and so breaks (viaMissingMethodException) any libraries that depend on it directly.Visible Changes
The
ConfigurationFeatureDefinitionProviderOptionsconstructor argument is separated into an overloaded constructor, restoring the < 4.4.0 constructor signature.