From f551136586b2cde9a1c382f9f259323ea1b4c0fd Mon Sep 17 00:00:00 2001 From: hamed naeemaei Date: Fri, 29 Aug 2025 14:44:54 +0330 Subject: [PATCH] SignalR: Throw exception when method does not exist. --- src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs b/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs index f52e5ba32357..956b89b8b53e 100644 --- a/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs +++ b/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs @@ -2419,7 +2419,7 @@ IReadOnlyList IInvocationBinder.GetParameterTypes(string methodName) if (!_hubConnection._handlers.TryGetValue(methodName, out var invocationHandlerList)) { Log.MissingHandler(_logger, methodName); - return Type.EmptyTypes; + throw new KeyNotFoundException($"Method with name '{methodName}' does not exist."); } // We use the parameter types of the first handler