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

typeof(Queryable).GetMethods() returns the result in different order for .NET 5 and .NET 6 #71422

Closed
syncsiva opened this issue Jun 28, 2022 · 4 comments

Comments

@syncsiva
Copy link

syncsiva commented Jun 28, 2022

Description

Below code returns different results between .NET 5 and .NET 6.

var queryableaverageMethod = typeof(Queryable).GetMethods().Where(m => m.Name == "Average" && m.GetParameters().Length == 2).ToArray();

In the below image you can see order of methods is changed between .NET 5 and .NET 6.

image

Configuration

6.0.106 - Issue reproduced
6.0.301 - issue reproduced
6.0.203 - issue reproduced

Regression?

Yes.

@syncsiva syncsiva changed the title typeof(Queryable).GetMethods() returns result in different order between .NET 5 and .NET 6 typeof(Queryable).GetMethods() returns the result in different order for .NET 5 and .NET 6 Jun 28, 2022
@svick
Copy link
Contributor

svick commented Jun 28, 2022

I think this is effectively a duplicate of #46272, which is going to be fixed in .Net 7. So you should get a consistent order starting with .Net 7 (assuming the source code of Queryable doesn't reorder the methods).

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 29, 2022
@adamsitnik adamsitnik added area-System.Linq and removed untriaged New issue has not been triaged by the area owner labels Jun 29, 2022
@adamsitnik adamsitnik transferred this issue from dotnet/core Jun 29, 2022
@ghost
Copy link

ghost commented Jun 29, 2022

Tagging subscribers to this area: @dotnet/area-system-linq
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Below code returns different results between .NET 5 and .NET 6.

var queryableaverageMethod = typeof(Queryable).GetMethods().Where(m => m.Name == "Average" && m.GetParameters().Length == 2).ToArray();

In the below image you can see order of methods is changed between .NET 5 and .NET 6.

image

Configuration

6.0.106 - Issue reproduced
6.0.301 - issue reproduced
6.0.203 - issue reproduced

Regression?

Yes.

Author: syncsiva
Assignees: -
Labels:

area-System.Linq

Milestone: -

@eiriktsarpalis
Copy link
Member

Closing as duplicate of #46272.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants