uno.extensions
uno.extensions copied to clipboard
`AsReadOnly<T>` conflicts with `System.Collections.Generic.CollectionExtensions`
What would you like to be added:
Note this extension does not come from Uno Extensions, but from Uno.Core package
When Uno Extensions are included in an app, the Uno.Core AsReadOnly extension will conflict with the .NET built-in one, as Uno Extensions adds global using for Uno.Extensions namespace, so both are included by default when the user uses Uno Extensions, so AsReadOnly is essentially unusable as an extension method.
I think it may be just better to keep this one internal only or remove it altogether.
Why is this needed:
Usability
For which Platform:
All
Uno.Core does not provide this particular extension, it is a sub-package that provides it. If need be, the dependency should be decomposed to avoid using that particular sub-package that provides this extension.
@MartinZikmund / @jeromelaban has anything been done about this?
@nickrandolph not yet, not sure if this would be a breaking change that we can safely do?
No change has been done for this. The only way to change this is to ensure that uno.extensions does not rely on uno.core, but only the required sub packages.
I think no matter what we do, there has to be a binary break here, but hopefully not major.
https://github.com/unoplatform/Uno.Core/pull/90 will be updating to net7.0 instead of net5.0/net6.0, and AsReadOnly will not be included for net7.0 (it will be kept for netstandard2.0 and uap though)
Uno.Core 4.1.1 is in the dev feed. @nickrandolph it would be interesting to avoid depending on Uno.Core directly, and use the subpackages that are only required by the extensions package that uses it. (list of packages https://github.com/unoplatform/Uno.Core#unocore)