Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Blazor] IL Linker not working correctly with IQueryable extensions #12917
From @ivanchev on Friday, 08 February 2019 09:55:31
Describe the bug
If you create a class library with some IQueryable extensions, for instance:
Using that in a WebAssembly Blazor project produces error.
Steps to reproduce the behavior:
No error thrown.
If you disable the IL Linker the issue is not observed:
Tested with both 0.7 and 0.8 versions.
Copied from original issue: aspnet/AspNetCore#7383
referenced this issue
Feb 9, 2019
Simple test case for the linker
Would this "work around" work for us on our UI component library? We're still waiting on a fix.
Having our customers disable Linker makes Blazor quite bloated.
Or if you are distributing an assembly I believe you can embed that descriptor in the assembly by embedding a linker resource in your assemble 'My.Assembly` by adding something like
to your .csprog
I am wondering if the issue I am having is related to this.
I am using Blazor to query documents in Cosmos DB, and having issues with the return from the following method.
In My Razor Page
IDocumentQuery InstanceList = client.CreateDocumentQuery(
Gives me this error:
It seems that there is some issue with IOrderedQueryable. CreateDocumentQuery returns the type IOrderedQueryable, and I can't change that. Even converting to List, etc. still gives me this error above. Is there some workaround for this?
I have tried the above, but all added System.Linq.IOrderedQueryable as a Type in the Linker.XML, but that just caused a bunch of other errors....
We don't support this dynamic code in linker right now and the workaround with using reflection (methodinfo) won't work either as the method is generic with generic type argument which cannot be expressed using reflection APIs.
If this is quite common we could extend the linker to have detection support for simple Expression cases like