Could you update the documentation for blazor worker to show that each function names must be unique with unique signatures.
Even though the compiler allows same function names, with different signatures, your plugin does not due to (presumably) limitations set by the way things are serialized.
An example that I ran into that appears to fail is...
//FAIL
public interface IContractService
{
public Task<byte[]> DoThis(string value);
public Task<byte[]> DoThis(double value);
}
//SUCCESS
public interface IContractService
{
public Task<byte[]> DoThis(string value);
public Task<byte[]> DoThat(double value);
}
console log of error:
ERROR: MessageEvent {isTrusted: true, data: {…}, origin: '', lastEventId: '', source: null, …}
VM8:3 ERROR: Exception has been thrown by the target of an invocation.
VM8:3 ERROR stacktrace: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
VM8:3 at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
VM8:3 at SpawnDev.BlazorJS.IJSInProcessRuntimeExtensions.Invoke(IJSInProcessRuntime _js, Type returnType, String identifier, Object[] args)
VM8:3 at SpawnDev.BlazorJS.JSInterop.Get(Type returnType, IJSInProcessObjectReference targetObject, Int32 identifier)
VM8:3 at SpawnDev.BlazorJS.IJSInProcessObjectReferenceExtensions.Get(IJSInProcessObjectReference targetObject, Type returnType, Int32 identifier)
VM8:3 at SpawnDev.BlazorJS.WebWorkers.ServiceCallDispatcher.PostDeserializeArgs(String requestId, MethodInfo methodInfo, Int32 argsLength, Func`3 getArg)
VM8:3 at SpawnDev.BlazorJS.WebWorkers.ServiceCallDispatcher._worker_OnMessage(MessageEvent e)
Could you update the documentation for blazor worker to show that each function names must be unique with unique signatures. Even though the compiler allows same function names, with different signatures, your plugin does not due to (presumably) limitations set by the way things are serialized.
An example that I ran into that appears to fail is...
//FAIL public interface IContractService { public Task<byte[]> DoThis(string value); public Task<byte[]> DoThis(double value); }
//SUCCESS public interface IContractService { public Task<byte[]> DoThis(string value); public Task<byte[]> DoThat(double value); }
console log of error:
ERROR: MessageEvent {isTrusted: true, data: {…}, origin: '', lastEventId: '', source: null, …} VM8:3 ERROR: Exception has been thrown by the target of an invocation. VM8:3 ERROR stacktrace: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) VM8:3 at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) VM8:3 at SpawnDev.BlazorJS.IJSInProcessRuntimeExtensions.Invoke(IJSInProcessRuntime _js, Type returnType, String identifier, Object[] args) VM8:3 at SpawnDev.BlazorJS.JSInterop.Get(Type returnType, IJSInProcessObjectReference targetObject, Int32 identifier) VM8:3 at SpawnDev.BlazorJS.IJSInProcessObjectReferenceExtensions.Get(IJSInProcessObjectReference targetObject, Type returnType, Int32 identifier) VM8:3 at SpawnDev.BlazorJS.WebWorkers.ServiceCallDispatcher.PostDeserializeArgs(String requestId, MethodInfo methodInfo, Int32 argsLength, Func`3 getArg) VM8:3 at SpawnDev.BlazorJS.WebWorkers.ServiceCallDispatcher._worker_OnMessage(MessageEvent e)