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

  1. Read the candidate signatures in the error message and align client argument types to match one listed overload
  2. If using overloads, ensure each has a distinct, unambiguous parameter type signature
  3. Verify JSON serialization settings on both client and server are compatible (e.g., camelCase vs PascalCase, number handling)
  4. 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

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


AI-assisted analysis of SignalR/SignalR@693053b89a (2026-08-13). Data as JSON: /api/errors/8cdceab7052f7d34. Report an issue: GitHub.