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

Hide ToHashSet in .net472 #1087

Open
svg2003 opened this issue Oct 31, 2024 · 2 comments
Open

Hide ToHashSet in .net472 #1087

svg2003 opened this issue Oct 31, 2024 · 2 comments

Comments

@svg2003
Copy link

svg2003 commented Oct 31, 2024

When MoreLinq is using with net472 target, it gives an error:

CS0121 The call is ambiguous between the following methods or properties: 'System.Linq.Enumerable.ToHashSet(System.Collections.Generic.IEnumerable)' and 'MoreLinq.MoreEnumerable.ToHashSet(System.Collections.Generic.IEnumerable)'

https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.tohashset?view=netstandard-2.1

image

@atifaziz
Copy link
Member

atifaziz commented Nov 3, 2024

To avoid the conflict, explicitly import the extensions you need from MoreLINQ.

@svg2003
Copy link
Author

svg2003 commented Nov 3, 2024

Thank you for the suggestion! However, given the current stage of .NET's evolution, it's quite common for developers to support code across at least two frameworks. Most would prefer do not write specific code just to handle some minor differences.

Since there's already a dedicated net8 target, I believe many others would also appreciate adding a dedicated net472 target. It’s more likely that developers would prefer using targeted netX framework versions rather than relying on a generic netstandard2 artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants