Merged
Conversation
The files moved need to live in the Light.GuardClauses.FrameworkExtensions namespace, and not the standard Light.GuardClauses namespace. This is so other polyfill libraries like https://github.com/SimonCropp/Polyfill can be used with Light.GuardClauses and not create conflicts.
This modifies the Contains extension methods to move it to a new namespace. Note this commit is separate from the rename operation in order to minimize the chance that Git loses file history tracking.
feO2x
approved these changes
Nov 26, 2025
Owner
feO2x
left a comment
There was a problem hiding this comment.
Interesting scenario I never thought about. I'm fine with this breaking change - will release version 14.0.0 of Light.GuardClauses soon.
Thank you for your contribution 🤗
Owner
|
I've just release Light.GuardClauses 14.0.0! Thanks again for your commitment! |
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.
This introduces a breaking change that moves the
Check.Contains(string, string, System.StringComparison)extension method into the Light.GuardClauses.FrameworkExtensions namespace and a newStringExtensionsclass so it is no longer automatically imported with the top-level Light.GuardClauses namespace.The reason for doing this is that not doing so conflicts with other polyfill libraries, such as Polyfill.
Basically any file that includes both namespaces and calls string.Contains(string, System.StringComparison) will fail to build in .NET Framework targets with error CS0121.
Moving it to the FrameworkExtensions namespace allows it to not only continue to be used by Light.GuardClauses itself (both in package and source references), but also continues to expose the extension method in some way for callers looking for just this polyfill and not a larger suite of polyfills such as PolyfillLib.