When I try to call a async generic method from JavaScript I get this error: The assembly '{assemblyName}' does not contain a public method with [{nameof(JSInvokableAttribute)}("{methodIdentifier}")].
[JSInvokable]
public static Task<string> GetAccessToken(string connectionId)
its related to ScanAssemblyForCallableMethods in https://github.com/aspnet/Blazor/blob/master/src/Microsoft.JSInterop/DotNetDispatcher.cs
It's a missing feature on this implementation?
And if it's, is someone working on implementing?
Hmm, well that error message seems a bit broken.
What values did you actually pass to the invokeMethodAsync call from JavaScript for the assembly name and the method name?
@danroth27 I麓m sorry, I copyed the error template from the source code. The error showme the "Blazor.Extensions.SignalR " as assmeblyName.
I'm triyng to migrate the SignalR extensions to the new JavaScript Interop spec. I can call others methods whitout problem and the diference bettwen then is Task
I'm also clone the Blazor repo and I will test on my machine to see what is happen whit this issue.
@danielmeza Could you please share the JavaScript code you are using to call the async .NET method that is failing?
Calling async methods that return Task should be fine. We have test cases that cover this: https://github.com/aspnet/Blazor/blob/master/test/testapps/BasicTestApp/wwwroot/js/jsinteroptests.js#L58.
@galvesribeiro FYI
Hey folks, thanks for ping me.
I鈥檓 doing the migration of all components right now. I hanged for a moment dealing with prototype collisions if you were using multiple BlazorExtension components in the same project due to the change/removal on the register method.
I just found a solution and will kee updating the packages. In an hour or so I expect the packages to be live.
Will keep you posted.
@galvesribeiro I solve the issue by changin the container class from internal to public so the refection not found the method if it麓s Generic and if the container class is not public.
@danielmeza I'm glad you solved your issue!