danroth27 / ComponentLibWithXmlLinkerConfig

Component library with embedded XML linker config file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running in Net Core 5.0

abbatepabloo opened this issue · comments

Hello @danroth27 and @SteveSandersonMS:

Thanks for this sample it was very usefull. I cloned and it worked like a charm.

I thought it would be nice to upgrade it to NetCore 5.0 so, in order to do this, I created a new solution using the latest templates provided by VS 2019 16.9.0 (Preview 2). You can check this link in order to see my project: https://github.com/abbatepabloo/ComponentLibWithXmlLinkerConfig/tree/master

I ran the webassembly project in VS (debug/release is the same) and it worked ok. That's because, as far as I know, there is no tree-shaking until you deploy the solution. But when you do it, VS doesn't seem to honor the indications of the embedded LinkerConfig.xml file in Blazor Component Library.

The project is running but is not able to execute the filter because there is no method available for that. The IL linker seems to ignore the statement:

<assembly fullname="System.Core"> <type fullname="System.Linq.Queryable" preserve="all" /> </assembly>
Probably I'm doing something wrong, but I can't figure out what it is?
Any help would be appreciated!

Exception:

Unhandled exception rendering component: TypeInitialization_Type, System.Linq.Dynamic.Core.Parser.EnumerationsFromMscorlib
System.TypeInitializationException: TypeInitialization_Type, System.Linq.Dynamic.Core.Parser.EnumerationsFromMscorlib ---> System.IO.FileNotFoundException: IO_FileName_Name, System.Runtime at System.Reflection.Assembly.Load(AssemblyName assemblyRef, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) at System.Linq.Dynamic.Core.Parser.EnumerationsFromMscorlib.AddEnumsFromAssembly(String assemblyName) at System.Linq.Dynamic.Core.Parser.EnumerationsFromMscorlib..cctor() Exception_EndOfInnerExceptionStack at System.Linq.Dynamic.Core.Parser.KeywordsHelper..ctor(ParsingConfig config) at System.Linq.Dynamic.Core.Parser.ExpressionParser..ctor(ParameterExpression[] parameters, String expression, Object[] values, ParsingConfig parsingConfig) at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Type delegateType, ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values) at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values) at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, Type itType, Type resultType, String expression, Object[] values) at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(IQueryable source, ParsingConfig config, String predicate, Object[] args) at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[Person](IQueryable1 source, ParsingConfig config, String predicate, Object[] args) at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[Person](IQueryable1 source, String predicate, Object[] args) at RazorClassLibrary1.Component1.OnClick() at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync[Object](MulticastDelegate delegate, Object arg) at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync(Object arg) at Microsoft.AspNetCore.Components.ComponentBase.Microsoft.AspNetCore.Components.IHandleEvent.HandleEventAsync(EventCallbackWorkItem callback, Object arg) at Microsoft.AspNetCore.Components.EventCallback.InvokeAsync(Object arg) at Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(UInt64 eventHandlerId, EventFieldInfo fieldInfo, EventArgs eventArgs) d.printErr @ blazor.webassembly.js:1 d.preRun.push.window.Blazor._internal.dotNetCriticalError @ blazor.webassembly.js:1 w @ blazor.webassembly.js:1 _mono_wasm_invoke_js_blazor @ dotnet.5.0.0.js:1 do_icall @ dotnet.wasm:0x194e46 do_icall_wrapper @ dotnet.wasm:0x79df6 interp_exec_method @ dotnet.wasm:0x44ad0 interp_runtime_invoke @ dotnet.wasm:0x12efed mono_jit_runtime_invoke @ dotnet.wasm:0x118e4d do_runtime_invoke @ dotnet.wasm:0x79d3f mono_runtime_invoke_checked @ dotnet.wasm:0xf65a mono_runtime_try_invoke_array @ dotnet.wasm:0x10e81f ves_icall_InternalInvoke @ dotnet.wasm:0xed48f ves_icall_InternalInvoke_raw @ dotnet.wasm:0xecf54 do_icall @ dotnet.wasm:0x194dd3 do_icall_wrapper @ dotnet.wasm:0x79df6 interp_exec_method @ dotnet.wasm:0x44ad0 interp_runtime_invoke @ dotnet.wasm:0x12efed mono_jit_runtime_invoke @ dotnet.wasm:0x118e4d do_runtime_invoke @ dotnet.wasm:0x79d3f mono_runtime_try_invoke @ dotnet.wasm:0x1297f mono_runtime_invoke @ dotnet.wasm:0x10ec19 mono_wasm_invoke_method @ dotnet.wasm:0x108e40 Module._mono_wasm_invoke_method @ dotnet.5.0.0.js:1 call_method @ dotnet.5.0.0.js:1 (anonymous) @ dotnet.5.0.0.js:1 beginInvokeDotNetFromJS @ blazor.webassembly.js:1 h @ blazor.webassembly.js:1 e.invokeMethodAsync @ blazor.webassembly.js:1 (anonymous) @ blazor.webassembly.js:1 invokeWhenHeapUnlocked @ blazor.webassembly.js:1 (anonymous) @ blazor.webassembly.js:1 t.dispatchEvent @ blazor.webassembly.js:1 (anonymous) @ blazor.webassembly.js:1 (anonymous) @ blazor.webassembly.js:1 e.onGlobalEvent @ blazor.webassembly.js:1