Skip to content

[Core] AsReadOnly<T> conflicts with System.Collections.Generic.CollectionExtensions #2225

Closed

Description

@MartinZikmund

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.

image

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

Activity

  1. added
    kind/enhancement
    triage/untriaged
    on Mar 29, 2024
  2. transferred this issue fromunoplatform/unoon Apr 1, 2024
  3. jeromelaban commented on Apr 1, 2024

    @jeromelaban
    Member

    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.

  4. nickrandolph commented on May 7, 2024

    @nickrandolph
    Contributor

    @MartinZikmund / @jeromelaban has anything been done about this?

  5. MartinZikmund commented on May 7, 2024

    @MartinZikmund
    MemberAuthor

    @nickrandolph not yet, not sure if this would be a breaking change that we can safely do?

  6. changed the title [-]`AsReadOnly<T>` conflicts with `System.Collections.Generic.CollectionExtensions`[/-] [+][Core] `AsReadOnly<T>` conflicts with `System.Collections.Generic.CollectionExtensions`[/+] on May 7, 2024
  7. jeromelaban commented on May 7, 2024

    @jeromelaban
    Member

    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.

  8. self-assigned this
    on Jun 11, 2024
  9. Youssef1313 commented on Jun 11, 2024

    @Youssef1313
    Member

    I think no matter what we do, there has to be a binary break here, but hopefully not major.

  10. Youssef1313 commented on Jun 11, 2024

    @Youssef1313
    Member

    unoplatform/Uno.Core#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)

  11. jeromelaban commented on Jun 14, 2024

    @jeromelaban
    Member

    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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/enhancementtriage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions