{"record":{"id":"59f378d923841f31","repo":"dotnet/reactive","slug":"there-is-no-method-0-on-type-1-that-matches-the-specified-59f378","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":"Rx.NET/Source/src/System.Reactive/ObservableQuery.cs","lineNumber":403,"sourceCode":"                else\n                {\n                    targetType = method.DeclaringType!; // NB: These methods were found from a declaring type.\n\n                    if (targetType.IsDefined(typeof(LocalQueryMethodImplementationTypeAttribute), false))\n                    {\n                        var mapping = (LocalQueryMethodImplementationTypeAttribute)targetType.GetCustomAttributes(typeof(LocalQueryMethodImplementationTypeAttribute), false)[0];\n                        targetType = mapping.TargetType;\n                    }\n\n                    methods = GetMethods(targetType);\n                }\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                    ?? throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings_Providers.NO_MATCHING_METHOD_FOUND, method.Name, targetType.Name));\n\n                //\n                // Restore generic arguments.\n                //\n                if (typeArgs != null)\n                {\n                    targetMethod = targetMethod.MakeGenericMethod(typeArgs);\n                }\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","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/ObservableQuery.cs#L385-L421","documentation":"FindObservableMethod rewrites a Queryable method call to the corresponding Qbservable operator. When no overload on the target type matches the argument list (checked via ArgsMatch), it throws InvalidOperationException 'There is no method {0} on type {1} that matches the specified arguments'. This means the query expression contains a call the IQbservable side has no compatible operator for.","triggerScenarios":"A Queryable expression tree contains a method call whose name exists on Qbservable but whose parameter types/counts do not match any overload — e.g. custom projections, extra predicates, unsupported operator signatures (like Queryable.Where with an index-based predicate that Qbservable lacks), or generic type argument mismatches.","commonSituations":"Mixing standard LINQ operators not mirrored by Qbservable, passing lambdas with different arity (e.g. (x, i) => ...) into a bridged query, or library upgrades where signatures diverged.","solutions":["Rewrite the query to use only operators/overloads available on IQbservable/Qbservable with matching signatures","Replace index-based or multi-parameter overloads (e.g. Func<T,int,bool>) with supported single-parameter forms","Perform the unsupported transformation after ToEnumerable()/AsQueryable() on the local queryable","Inspect the failing method name and targetType in the message and compare overloads on Qbservable"],"exampleFix":"// before\nsource.AsQbservable().Where((x, i) => i > 0).ToEnumerable().AsQueryable()\n// after\nsource.AsQbservable().Where(x => x > 0).ToEnumerable().AsQueryable()","handlingStrategy":"validation","validationCode":"var candidate = typeof(Qbservable).GetMethods().Any(m => m.Name == methodName && ParametersCompatible(m, args)); if (!candidate) throw new NotSupportedException($\"No Qbservable operator '{methodName}' matches the given arguments\");","typeGuard":"static bool HasObservableOperator(string name, params Type[] argTypes) => typeof(Qbservable).GetMethods(BindingFlags.Public | BindingFlags.Static).Any(m => m.Name == name && m.GetParameters().Length == argTypes.Length + 1);","tryCatchPattern":"try { return provider.CreateQuery(expr); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"no method\")) { throw new NotSupportedException($\"Operator not supported on IQbservable: {ex.Message}\"); }","preventionTips":["Use only overloads that exist identically on Queryable and Qbservable (same parameter shapes)","Avoid index-based lambdas and custom extension methods inside bridged queries","Compare your operator signature against Qbservable's public API when writing bridged queries"],"tags":["linq","expression-tree","rx","method-resolution"],"backgroundTag":"method-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"}