{"record":{"id":"d3b26b9ce8302920","repo":"dotnet/reactive","slug":"specified-method-is-not-supported-yielder","errorCode":null,"errorMessage":"Specified method is not supported.","messagePattern":"Specified method is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Ix.NET/Source/System.Interactive/System/Linq/Yielder.cs","lineNumber":75,"sourceCode":"        public Yielder<T> GetEnumerator() => this;\n\n        public bool MoveNext()\n        {\n            if (!_running)\n            {\n                _running = true;\n                _create(this);\n            }\n            else\n            {\n                _hasValue = false;\n                _continuation!();\n            }\n\n            return !_stopped && _hasValue;\n        }\n\n        public void Reset() => throw new NotSupportedException();\n    }\n}\n","sourceCodeStart":57,"sourceCodeEnd":78,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Ix.NET/Source/System.Interactive/System/Linq/Yielder.cs#L57-L78","documentation":"Yielder<T> is a compiler-less iterator helper implementing IEnumerator<T>. IEnumerator.Reset is not supported by iterator-style enumerators, so Yielder.Reset unconditionally throws NotSupportedException (\"Specified method is not supported.\") — mirroring the behavior of C# compiler-generated iterators.","triggerScenarios":"Calling `Reset()` on an enumerator produced by a Yielder-backed operator, e.g. legacy code that assumed enumerators are restartable, or code doing `enumerator.Reset(); enumerator.MoveNext()` to replay a sequence.","commonSituations":"Porting .NET 1.x-style enumeration code that relied on Reset, reusing an enumerator for a second pass over a LINQ/Ix sequence, or framework code that defensively calls Reset before reuse.","solutions":["Get a fresh enumerator via GetEnumerator() (or re-invoke the operator) instead of calling Reset.","Materialize the sequence (ToList/ToArray) if you need multiple passes.","Restructure the consumer to a single forward-only pass.","If you own the consuming framework, remove Reset-based reuse logic."],"exampleFix":"// before\ne.Reset();\nwhile (e.MoveNext()) Process(e.Current);\n// after\nforeach (var item in sequence) Process(item); // or sequence.GetEnumerator() again","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { enumerator.Reset(); }\ncatch (NotSupportedException) { enumerator = sequence.GetEnumerator(); // fresh enumerator instead\n}","preventionTips":["Treat all iterators as forward-only; never call Reset.","Re-acquire enumerators or re-invoke operators for new passes.","Materialize sequences that need multiple traversals.","Update legacy enumeration code that assumed Reset works."],"tags":["linq","not-supported","enumerator","ix-interactive"],"backgroundTag":"unsupported-operation","analyzedSha":"94b5d5ab912789f5abe9a72138a25bbd716fe59c","analyzedAt":"2026-09-15T02:26:24.759Z","contentChangedAt":"2026-09-15T02:26:24.759Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}