{"record":{"id":"8cdceab7052f7d34","repo":"SignalR/SignalR","slug":"0-method-could-not-be-resolved-potential-cand","errorCode":null,"errorMessage":"'{0}' method could not be resolved. Potential candidates are: {1}","messagePattern":"'(.+?)' method could not be resolved\\. Potential candidates are: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.AspNet.SignalR.Core/Hubs/Lookup/Descriptors/NullMethodDescriptor.cs","lineNumber":38,"sourceCode":"        public NullMethodDescriptor(HubDescriptor descriptor, string methodName, IEnumerable<MethodDescriptor> availableMethods)\n        {\n            _methodName = methodName;\n            _availableMethods = availableMethods;\n            Hub = descriptor;\n        }\n\n        public override Func<IHub, object[], object> Invoker\n        {\n            get\n            {\n                return (emptyHub, emptyParameters) =>\n                {\n                    IEnumerable<string> availableMethodSignatures = GetAvailableMethodSignatures().ToArray();\n                    var message = availableMethodSignatures.Any() ? \n                        String.Format(CultureInfo.CurrentCulture, Resources.Error_MethodCouldNotBeResolvedCandidates, _methodName, \"\\n\" + String.Join(\"\\n\", availableMethodSignatures)) :\n                        String.Format(CultureInfo.CurrentCulture, Resources.Error_MethodCouldNotBeResolved, _methodName);\n                        \n                    throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, message));\n                };\n            }\n        }\n\n        private IEnumerable<string> GetAvailableMethodSignatures()\n        {\n            return _availableMethods.Select(m => m.Name + \"(\" + String.Join(\", \", m.Parameters.Select(p => p.Name + \":\" + p.ParameterType.Name)) + \"):\" + m.ReturnType.Name);\n        }\n\n        public override IList<ParameterDescriptor> Parameters\n        {\n            get { return _parameters; }\n        }\n\n        public override IEnumerable<Attribute> Attributes \n        {\n            get { return _attributes; }\n        }","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/SignalR/SignalR/blob/693053b89a9e1f5ce819e3233ed159a6409de22b/src/Microsoft.AspNet.SignalR.Core/Hubs/Lookup/Descriptors/NullMethodDescriptor.cs#L20-L56","documentation":"Thrown when a client invokes a hub method by name and the name matches one or more overloaded methods, but none of the overloads have a parameter signature compatible with the supplied arguments. The error message lists the available candidate signatures (name, parameter types, return type) to aid debugging. This is a runtime dispatch failure — the method name exists but the argument types or count do not align.","triggerScenarios":"Client calls server.methodName(args) where the argument types do not match any overload — e.g., sending a string where an int is expected, or sending the wrong number of arguments for all overloads.","commonSituations":"Overloaded hub methods where the client sends arguments of unexpected types; JSON serialization producing different types than expected (e.g., a number serialized as a string); client/server version mismatch where method signatures changed between deployments.","solutions":["Read the candidate signatures in the error message and align client argument types to match one listed overload","If using overloads, ensure each has a distinct, unambiguous parameter type signature","Verify JSON serialization settings on both client and server are compatible (e.g., camelCase vs PascalCase, number handling)","Check the number of arguments — a count mismatch against all overloads triggers this error"],"exampleFix":"// before (server)\npublic void Update(int id) { }\npublic void Update(string name) { }\n// client sends: server.update(true); // no matching overload\n\n// after\nserver.update(42); // matches Update(int id)","handlingStrategy":"try-catch","validationCode":"// Server-side: verify method signature is unambiguous\n// Client-side: ensure argument types match the server method\n// Before invoking, confirm arg types align with the server's expected signature","typeGuard":null,"tryCatchPattern":"// On the client, catch and log the dispatch error\nconnection.hub.error(function(err) {\n    if (err.message.indexOf('could not be resolved') !== -1) {\n        console.error('Method dispatch failed. Check argument types:', err);\n    }\n});","preventionTips":["Avoid overloaded hub methods when possible — use distinct method names instead","If overloads are necessary, ensure parameter types are sufficiently distinct (not just int vs long)","Verify client argument types match server parameter types exactly (mind JSON number coercion)","Log the candidate signatures from the error message to diagnose type mismatches","Keep client and server method contracts in sync during version updates"],"tags":["signalr","hubs","method-resolution","overloading","serialization","client-server"],"backgroundTag":null,"analyzedSha":"693053b89a9e1f5ce819e3233ed159a6409de22b","analyzedAt":"2026-08-13T22:23:59.793Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}