SignalR/SignalR · error · InvalidOperationException
'{0}' method could not be resolved. Potential candidates are
Error message
'{0}' method could not be resolved. Potential candidates are: {1} What it means
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.
Source
Thrown at src/Microsoft.AspNet.SignalR.Core/Hubs/Lookup/Descriptors/NullMethodDescriptor.cs:38
public NullMethodDescriptor(HubDescriptor descriptor, string methodName, IEnumerable<MethodDescriptor> availableMethods)
{
_methodName = methodName;
_availableMethods = availableMethods;
Hub = descriptor;
}
public override Func<IHub, object[], object> Invoker
{
get
{
return (emptyHub, emptyParameters) =>
{
IEnumerable<string> availableMethodSignatures = GetAvailableMethodSignatures().ToArray();
var message = availableMethodSignatures.Any() ?
String.Format(CultureInfo.CurrentCulture, Resources.Error_MethodCouldNotBeResolvedCandidates, _methodName, "\n" + String.Join("\n", availableMethodSignatures)) :
String.Format(CultureInfo.CurrentCulture, Resources.Error_MethodCouldNotBeResolved, _methodName);
throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, message));
};
}
}
private IEnumerable<string> GetAvailableMethodSignatures()
{
return _availableMethods.Select(m => m.Name + "(" + String.Join(", ", m.Parameters.Select(p => p.Name + ":" + p.ParameterType.Name)) + "):" + m.ReturnType.Name);
}
public override IList<ParameterDescriptor> Parameters
{
get { return _parameters; }
}
public override IEnumerable<Attribute> Attributes
{
get { return _attributes; }
}View on GitHub (pinned to 693053b89a)
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
Example fix
// before (server)
public void Update(int id) { }
public void Update(string name) { }
// client sends: server.update(true); // no matching overload
// after
server.update(42); // matches Update(int id) Defensive patterns
Strategy: try-catch
Validate before calling
// Server-side: verify method signature is unambiguous // Client-side: ensure argument types match the server method // Before invoking, confirm arg types align with the server's expected signature
Try / catch
// On the client, catch and log the dispatch error
connection.hub.error(function(err) {
if (err.message.indexOf('could not be resolved') !== -1) {
console.error('Method dispatch failed. Check argument types:', err);
}
}); Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- '{0}' method could not be resolved. No method found with tha
- SignalR: SignalR is not loaded. Please ensure jquery.signalR
- SignalR: Error loading hubs. Ensure your hubs reference is c
- A client callback for event {0} with {1} argument(s) was fou
- convert
AI-assisted analysis of SignalR/SignalR@693053b89a (2026-08-13).
Data as JSON: /api/errors/8cdceab7052f7d34.
Report an issue: GitHub.