System.Linq.Dynamic.Core: [Blazor webassembly] library not working with linker disabled

Hello and thanks for your work ! I use your library in one of my blazor webassembly project, but it seem not working when the linkler is disabled

You will find a reproduction project here : https://github.com/julienGrd/blazorWebassembly3.2Preview1

  • run the app
  • go to fetch data
  • open the chrome console, you will see this exception
System.TypeInitializationException: The type initializer for 'System.Linq.Dynamic.Core.DynamicQueryableExtensions' threw an exception. ---> System.Exception: Specific method not found: All ---> System.InvalidOperationException: Sequence contains no matching element

It seem this issue is related to this one on mono, if it can help : https://github.com/mono/mono/issues/12917

if you disable the linker(in the webassembly csproj) there is no longer problem, but it’s not a good thing and make the app bigger

 <PropertyGroup>
    <BlazorWebAssemblyEnableLinking>false</BlazorWebAssemblyEnableLinking>
  </PropertyGroup>

thanks for your help !

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Keep it simple.

@julienGrd Docs on how to configure the linker for libraries are in the works: https://github.com/dotnet/AspNetCore.Docs/issues/17369

Is this file not impact other .NET standard type of project? because its not a blazor specific library !

All this is doing is embedded the XML linker config file into the assembly. This file will get picked up appropriately by the .NET IL linker wherever it gets used, including Xamarin apps and standalone .NET Core desktop apps. For apps that aren’t using the linker this file is completely benign.

In short, this file is not Blazor specific and is safe to add to any .NET Standard library.