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

[6.0.100-preview.4.21177.4] Radzen Blazor Dropdown Component with multiple selection exception run against .net6 #50349

Closed
jiangzeng01 opened this issue Mar 29, 2021 · 4 comments
Assignees
Milestone

Comments

@jiangzeng01
Copy link
Contributor

Application Name: BlazorBlogs (Radzen Blazor Dropdown Component, Dropdown with multiple selection)
OS: Windows 10 RS5
CPU: X64
.NET Build Number: 6.0.100-preview.4.21177.4
**Source Code & repro app: ** check at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1302233
(This is 5.0 app, issue occurs when we run against 6.0 prev3)
Verify Scenarios:
1). Windows 10 RS5 X64 + .NET Core SDK build 6.0.100-preview.4.21177.4: Fail
2). Windows 10 RS5 X64 + .NET Core SDK build 6.0.100-preview.2.21158.2: Pass
3). Windows 10 RS5 X64 + .NET Core SDK build 5.0.104 : Pass

Steps to reproduce:

  1. On CMD, run "dotnet TestLinq.dll"
  2. Go to http://localhost:5000/counter
  3. In dropdown, select item

Expected Result:
It should select items

Actual Result:

    System.TypeInitializationException: The type initializer for 'System.Linq.Dynamic.Core.DynamicQueryableExtensions' threw an exception.
       ---> System.Exception: Specific method not found: Take
       ---> System.InvalidOperationException: Sequence contains more than one matching element
         at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
         at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.GetMethod(String name, Int32 parameterCount, Func`2 predicate)
         --- End of inner exception stack trace ---
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.GetMethod(String name, Int32 parameterCount, Func`2 predicate)
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions..cctor()
         --- End of inner exception stack trace ---
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Cast(IQueryable source, Type type)
         at Radzen.DropDownBase`1.SelectItem(Object item, Boolean raiseChange)
         at Radzen.Blazor.RadzenDropDown`1.OnSelectItem(Object item, Boolean isFromKey)
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

Findings:
Exception comes from a package that Radzen uses package: System.Linq.Dynamic.Core
Sample console project to repro this issue : link check at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1302233

       IEnumerable<string> multipleValues = new string[] { "aa", "bb" };
       Type mytype = multipleValues.Cast<object>().FirstOrDefault().GetType();
        var obj = multipleValues.AsQueryable().Cast(mytype);

Above code works on .net5 but fails on .net6 Prev3.

Exception :

Unhandled exception. System.TypeInitializationException: The type initializer for 'System.Linq.Dynamic.Core.DynamicQueryableExtensions' threw an exception.
 ---> System.Exception: Specific method not found: Take
 ---> System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.GetMethod(String name, Int32 parameterCount, Func`2 predicate)
   --- End of inner exception stack trace ---
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.GetMethod(String name, Int32 parameterCount, Func`2 predicate)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions..cctor()
   --- End of inner exception stack trace ---
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Cast(IQueryable source, Type type)
   at TestLinq.Program.Main(String[] args) in C:\Users\appcompat\Documents\TestLinq\Program.cs:line 14

We think this issue is caused by system.linq change here : #28776
Should be same issue with #49683, but need to get confirmation.

Impact:
1 real-world app (BlazorBlogs) failed in AppCompat lab.
The app is using Radzen Dropdown multiple selection feature, this is how we found this issue, this might affect other components as well.
The error should be from package https://www.nuget.org/packages/System.Linq.Dynamic.Core/, apps which are using this package's multiple selection feature will break if run against with .runtime NET 6 Preview 3 and later.

@dotnet-actwx-bot @dotnet/compat

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Linq untriaged New issue has not been triaged by the area owner labels Mar 29, 2021
@ghost
Copy link

ghost commented Mar 29, 2021

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

Issue Details

Application Name: BlazorBlogs (Radzen Blazor Dropdown Component, Dropdown with multiple selection)
OS: Windows 10 RS5
CPU: X64
.NET Build Number: 6.0.100-preview.4.21177.4
**Source Code & repro app: ** check at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1302233
(This is 5.0 app, issue occurs when we run against 6.0 prev3)
Verify Scenarios:
1). Windows 10 RS5 X64 + .NET Core SDK build 6.0.100-preview.4.21177.4: Fail
2). Windows 10 RS5 X64 + .NET Core SDK build 6.0.100-preview.2.21158.2: Pass
3). Windows 10 RS5 X64 + .NET Core SDK build 5.0.104 : Pass

Steps to reproduce:

  1. On CMD, run "dotnet TestLinq.dll"
  2. Go to http://localhost:5000/counter
  3. In dropdown, select item

Expected Result:
It should select items

Actual Result:

    System.TypeInitializationException: The type initializer for 'System.Linq.Dynamic.Core.DynamicQueryableExtensions' threw an exception.
       ---> System.Exception: Specific method not found: Take
       ---> System.InvalidOperationException: Sequence contains more than one matching element
         at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
         at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.GetMethod(String name, Int32 parameterCount, Func`2 predicate)
         --- End of inner exception stack trace ---
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.GetMethod(String name, Int32 parameterCount, Func`2 predicate)
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions..cctor()
         --- End of inner exception stack trace ---
         at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Cast(IQueryable source, Type type)
         at Radzen.DropDownBase`1.SelectItem(Object item, Boolean raiseChange)
         at Radzen.Blazor.RadzenDropDown`1.OnSelectItem(Object item, Boolean isFromKey)
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

Findings:
Exception comes from a package that Radzen uses package: System.Linq.Dynamic.Core
Sample console project to repro this issue : link check at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1302233

       IEnumerable<string> multipleValues = new string[] { "aa", "bb" };
       Type mytype = multipleValues.Cast<object>().FirstOrDefault().GetType();
        var obj = multipleValues.AsQueryable().Cast(mytype);

Above code works on .net5 but fails on .net6 Prev3.

Exception :

Unhandled exception. System.TypeInitializationException: The type initializer for 'System.Linq.Dynamic.Core.DynamicQueryableExtensions' threw an exception.
 ---> System.Exception: Specific method not found: Take
 ---> System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.GetMethod(String name, Int32 parameterCount, Func`2 predicate)
   --- End of inner exception stack trace ---
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.GetMethod(String name, Int32 parameterCount, Func`2 predicate)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions..cctor()
   --- End of inner exception stack trace ---
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Cast(IQueryable source, Type type)
   at TestLinq.Program.Main(String[] args) in C:\Users\appcompat\Documents\TestLinq\Program.cs:line 14

We think this issue is caused by system.linq change here : #28776
Should be same issue with #49683, but need to get confirmation.

Impact:
1 real-world app (BlazorBlogs) failed in AppCompat lab.
The app is using Radzen Dropdown multiple selection feature, this is how we found this issue, this might affect other components as well.
The error should be from package https://www.nuget.org/packages/System.Linq.Dynamic.Core/, apps which are using this package's multiple selection feature will break if run against with .runtime NET 6 Preview 3 and later.

@dotnet-actwx-bot @dotnet/compat

Author: jiangzeng01
Assignees: eiriktsarpalis
Labels:

area-System.Linq, untriaged

Milestone: -

@jiangzeng01
Copy link
Contributor Author

jiangzeng01 commented Mar 29, 2021

@eiriktsarpalis From this issue, it looks like another 2 packages impacted by LINQ apis change.
Could you please confirm this?
These package https://www.nuget.org/packages/System.Linq.Dynamic.Core/ & https://www.nuget.org/packages/Radzen.Blazor/ are very popular, 18,539,843 total downloads & 359,212 total downloads.
Apps use these 2 packages (Dropdown with multiple selection) might break when running against .NET 6 Preview 3.

@eiriktsarpalis
Copy link
Member

It is the same issue as #49683. I would recommend filing a ticket with the package authors, citing this issue dotnet/docs#23421.

@eiriktsarpalis eiriktsarpalis removed the untriaged New issue has not been triaged by the area owner label Mar 29, 2021
@eiriktsarpalis eiriktsarpalis added this to the 6.0.0 milestone Mar 29, 2021
@jiangzeng01
Copy link
Contributor Author

@eiriktsarpalis Thanks for confirmation! I saw you already filled a ticket with the package owner.
I'm closing this issue as it's confirmed, it should be by design.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 29, 2021
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

2 participants