RadzenAutoComplete not working System.Linq.Dynamic.Core

I know there have been reported similar problems but I still could not find a solution for my problem.

I am using Radzen.Blazor 5.9.8.
RadzenAutoComplete worked fine until I updated System.Linq.Dynamic.Core to 1.6.0.2 because this library contains a vulnerability.

Now RadzenAutoComplete gives an error:

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: The type initializer for 'Radzen.Blazor.DynamicLinqCustomTypeProvider' threw an exception.
System.TypeInitializationException: The type initializer for 'Radzen.Blazor.DynamicLinqCustomTypeProvider' threw an exception.
---> System.MissingMethodException: Method not found: void System.Linq.Dynamic.Core.ParsingConfig.set_CustomTypeProvider(System.Linq.Dynamic.Core.CustomTypeProviders.IDynamicLinkCustomTypeProvider)
--- End of inner exception stack trace ---
at Radzen.Blazor.RadzenAutoComplete.get_View()
at Radzen.Blazor.RadzenAutoComplete.BuildRenderTree(RenderTreeBuilder __builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

Hi @Petteri,

We can't reproduce such error with 1.6.0.2. This error however was present with another version 1.6.1 which is known to be problematic and has been unlisted from nuget. More info here: Dropdown Stopped working after System.Linq.Dynamic.Core upgrade to 1.6+ - #5 by korchev

I created a new Blazor WASM solution with Radzen.Blazor 5.9.8 and System.Linq.Dynamic.Core 1.6.0.2. In this solution the RadzenAutoComplete works fine!

Then I simplified my original solution to this:

@page "/"
<PageTitle>Home</PageTitle>
<h1>Radzen test</h1>
<RadzenAutoComplete Data="_testList" />

@code {
    private List<string> _testList = ["test1", "test2", "test3"];
}

This gives the exception I pasted above!
The code is the same for both solutions.

I can't figure out what is the difference between my two solutions.

Try to clean your solution and rebuild it.

1 Like

Now it works. I feel stupid now :grinning:
But thank you very much for your help!

1 Like

You are the best/saved me a lot of time