{"record":{"id":"2b5af582668e14e1","repo":"dotnet/reactive","slug":"there-is-no-method-0-on-type-1-that-matches-the-specified","errorCode":null,"errorMessage":"There is no method '{0}' on type '{1}' that matches the specified arguments","messagePattern":"There is no method '(.+?)' on type '(.+?)' that matches the specified arguments","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Ix.NET/Source/System.Interactive.Providers/System/Linq/QueryableEx.cs","lineNumber":69,"sourceCode":"                {\n                    if (mce.Arguments.Count >= 1 && typeof(IQueryProvider).IsAssignableFrom(mce.Arguments[0].Type))\n                    {\n                        if (mce.Arguments[0] is ConstantExpression ce)\n                        {\n                            if (ce.Value is QueryProviderShim)\n                            {\n                                var targetType = typeof(QueryableEx);\n                                var method = mce.Method;\n                                var methods = GetMethods(targetType);\n                                var arguments = mce.Arguments.Skip(1).ToList();\n\n                                //\n                                // From all the operators with the method's name, find the one that matches all arguments.\n                                //\n                                var typeArgs = method.IsGenericMethod ? method.GetGenericArguments() : null;\n                                var targetMethod = methods[method.Name].FirstOrDefault(candidateMethod => ArgsMatch(candidateMethod, arguments, typeArgs));\n                                if (targetMethod == null)\n                                    throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, \"There is no method '{0}' on type '{1}' that matches the specified arguments\", method.Name, targetType.Name));\n\n                                //\n                                // Restore generic arguments.\n                                //\n                                if (typeArgs != null)\n                                    targetMethod = targetMethod.MakeGenericMethod(typeArgs);\n\n                                //\n                                // Finally, we need to deal with mismatches on Expression<Func<...>> versus Func<...>.\n                                //\n                                var parameters = targetMethod.GetParameters();\n                                for (int i = 0, n = parameters.Length; i < n; i++)\n                                {\n                                    arguments[i] = Unquote(arguments[i]);\n                                }\n\n                                //\n                                // Emit a new call to the discovered target method.","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Ix.NET/Source/System.Interactive.Providers/System/Linq/QueryableEx.cs#L51-L87","documentation":"In the Redir expression visitor, when redirecting a static call to the equivalent Ix.NET method, it searches all methods with the target name on the target type for one whose parameters match the supplied arguments. If none match, it throws InvalidOperationException(\"There is no method '<name>' on type '<type>' that matches the specified arguments\"). This means the expression's argument shapes cannot be reconciled with any overload in the Ix library.","triggerScenarios":"Query translation where the redirected method name exists on the target type but no overload accepts the argument count/types, or where generic type arguments inferred from the source method do not satisfy any candidate.","commonSituations":"Using an overload signature that the Ix operator does not implement (e.g. different comparer/selector arity), version drift between the app's operator usage and the installed Ix version, or provider-generated expressions with wrapped/quoted argument types.","solutions":["Change the query to use an overload that exists on the Ix operator (match parameter count and types to the library signature).","Check that System.Interactive / System.Interactive.Providers versions are consistent and support the overload you used.","Wrap the arguments in explicit AsQueryable()/casts so argument types align with the target overload.","If the operator genuinely lacks the overload, implement the logic client-side (AsEnumerable) instead of redirecting."],"exampleFix":"// before\n// redirect fails: no matching overload with 2 args\nvar q = source.MyOp(x => x.Id, comparer);\n// after\n// use the supported overload arity\nvar q = source.MyOp(x => x.Id);","handlingStrategy":"try-catch","validationCode":"var candidates = typeof(IxOps).GetMethods().Where(m => m.Name == opName && m.GetParameters().Length == args.Count); if (!candidates.Any()) throw new InvalidOperationException($\"No Ix overload '{opName}' accepts {args.Count} args\");","typeGuard":null,"tryCatchPattern":"try { var redirected = RedirectCall(node); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"that matches the specified arguments\")) { // fall back to client-side evaluation node.AsEnumerable() }","preventionTips":["Match operator calls exactly to documented Ix overload signatures.","Pin matching versions of System.Interactive across projects.","Prefer wrapping arguments (AsQueryable/casts) so types align with target overloads."],"tags":["linq","expression-translation","overload-resolution"],"backgroundTag":"resource-not-found","analyzedSha":"94b5d5ab912789f5abe9a72138a25bbd716fe59c","analyzedAt":"2026-09-15T02:26:24.759Z","contentChangedAt":"2026-09-15T02:26:24.759Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}